MetricFu::Flog::Page

Attributes

average_score[RW]
path[RW]
scanned_methods[RW]
score[RW]

Public Class Methods

new(score, average_score, scanned_methods = []) click to toggle source
# File lib/generators/flog.rb, line 148
def initialize(score, average_score, scanned_methods = [])
  @score = score.to_f
  @scanned_methods = scanned_methods
  @average_score = average_score.to_f
end

Public Instance Methods

filename() click to toggle source
# File lib/generators/flog.rb, line 154
def filename 
  File.basename(path, ".txt") 
end
highest_score() click to toggle source
# File lib/generators/flog.rb, line 166
def highest_score
  scanned_methods.inject(0) do |highest, m|
    m.score > highest ? m.score : highest
  end
end
to_h() click to toggle source
# File lib/generators/flog.rb, line 158
def to_h
  {:score => @score, 
   :scanned_methods => @scanned_methods.map {|sm| sm.to_h},
   :highest_score => highest_score,
   :average_score => average_score,
   :path => path}
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.