Sha256: 3962c0cf0a25aad5303209b6b3a87afdbd2f47933f948093b816e84ca402372b
Contents?: true
Size: 805 Bytes
Versions: 3
Compression:
Stored size: 805 Bytes
Contents
module Metricks::FlogReporter class Page attr_accessor :score, :scanned_methods def initialize(score, scanned_methods = []) @score = score.to_f @scanned_methods = scanned_methods end def to_html output = "<html><head><style>" output << Base.load_css output << "</style></head><body>" output << "Score: #{score}\n" scanned_methods.each do |sm| output << sm.to_html end output << "</body></html>" output end def average_score sum = 0 scanned_methods.each do |m| sum += m.score end sum / scanned_methods.length end def highest_score scanned_methods.inject(0) do |highest, m| m.score > highest ? m.score : highest end end end end
Version data entries
3 entries across 3 versions & 1 rubygems