Class: Ghaki::Stats::Format::Output

Inherits:
Base
  • Object
show all
Defined in:
lib/ghaki/stats/format/output.rb

Overview

Default formatting for generating Statistics Reports using an output file object.

Direct Known Subclasses

Logger

Instance Attribute Summary

Attributes inherited from Base

#title

Instance Method Summary collapse

Methods inherited from Base

#dump, #dump_head, #dump_tail, #initialize

Constructor Details

This class inherits a constructor from Ghaki::Stats::Format::Base

Instance Method Details

#dump_body(stats, log, title) ⇒ Object

Dumps body of stats.



13
14
15
16
17
18
19
20
21
# File 'lib/ghaki/stats/format/output.rb', line 13

def dump_body stats, log, title
  stats.keys.sort.each do |major|
    log.puts major + ':'
    stats[major].keys.sort.each do |minor|
      count = stats[major][minor]
      log.puts '    ' + count.to_s.rjust(8) + ' : ' + minor
    end
  end
end