Class: Ghaki::Stats::Format::Base

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

Overview

Base for Statistics Report formatting objects.

Direct Known Subclasses

Null, Output

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#titleObject

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