Class: ZombieScout::Formatter::ReportFormatter
Instance Attribute Summary
#mission, #report
Instance Method Summary
collapse
#initialize
Instance Method Details
#to_s ⇒ Object
20
21
22
23
24
25
26
27
|
# File 'lib/zombie_scout/formatter.rb', line 20
def to_s
one = "Scouted #{mission.defined_method_count} methods in #{mission.source_count} files, in #{mission.duration} seconds."
two = "Found #{mission.zombie_count} potential zombies, with a combined flog score of #{total_flog_score.round(1)}."
([one, two, "\n"] + report.map { |zombie|
[zombie[:location], zombie[:full_name], zombie[:flog_score]] * "\t"
}) * "\n"
end
|
#total_flog_score ⇒ Object
29
30
31
|
# File 'lib/zombie_scout/formatter.rb', line 29
def total_flog_score
report.map { |z| z[:flog_score] }.reduce(0, :+)
end
|