Class: Factbook::Counter
- Inherits:
-
Object
- Object
- Factbook::Counter
- Defined in:
- lib/factbook-readers/counter.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #count(page) ⇒ Object
-
#initialize ⇒ Counter
constructor
A new instance of Counter.
Constructor Details
#initialize ⇒ Counter
Returns a new instance of Counter.
9 10 11 |
# File 'lib/factbook-readers/counter.rb', line 9 def initialize @data = {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/factbook-readers/counter.rb', line 7 def data @data end |
Instance Method Details
#count(page) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/factbook-readers/counter.rb', line 13 def count( page ) ## walk page data hash # add nodes to data walk( page, page.data, @data ) end |