Class: Ghaki::Stats::Format::Base
- Inherits:
-
Object
- Object
- Ghaki::Stats::Format::Base
- Defined in:
- lib/ghaki/stats/format/base.rb
Overview
Base for Statistics Report formatting objects.
Instance Attribute Summary collapse
-
#title ⇒ Object
Name of statistics report.
Instance Method Summary collapse
-
#dump(stats, out, title = @title) ⇒ Object
Dump output from statistics object.
-
#dump_body(stats, out, title) ⇒ Object
Generate body of report.
-
#dump_head(stats, out, title) ⇒ Object
Generate header of report.
-
#dump_tail(stats, out, title) ⇒ Object
Generate footer of report.
-
#initialize(opts = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(opts = {}) ⇒ Base
Returns a new instance of Base.
12 13 14 |
# File 'lib/ghaki/stats/format/base.rb', line 12 def initialize opts={} @title = opts[:title] || '' end |
Instance Attribute Details
#title ⇒ Object
Name of statistics report.
10 11 12 |
# File 'lib/ghaki/stats/format/base.rb', line 10 def title @title end |
Instance Method Details
#dump(stats, out, title = @title) ⇒ Object
Dump output from statistics object.
18 19 20 21 22 |
# File 'lib/ghaki/stats/format/base.rb', line 18 def dump stats, out, title=@title dump_head stats, out, title dump_body stats, out, title dump_tail stats, out, title end |
#dump_body(stats, out, title) ⇒ Object
Generate body of report.
30 31 |
# File 'lib/ghaki/stats/format/base.rb', line 30 def dump_body stats, out, title end |
#dump_head(stats, out, title) ⇒ Object
Generate header of report.
26 27 |
# File 'lib/ghaki/stats/format/base.rb', line 26 def dump_head stats, out, title end |
#dump_tail(stats, out, title) ⇒ Object
Generate footer of report.
35 36 |
# File 'lib/ghaki/stats/format/base.rb', line 35 def dump_tail stats, out, title end |