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(code, page) ⇒ Object
-
#initialize ⇒ Counter
constructor
A new instance of Counter.
Constructor Details
#initialize ⇒ Counter
Returns a new instance of Counter.
8 9 10 |
# File 'lib/factbook-readers/counter.rb', line 8 def initialize @data = {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/factbook-readers/counter.rb', line 6 def data @data end |
Instance Method Details
#count(code, page) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/factbook-readers/counter.rb', line 12 def count( code, page ) ## walk page data hash # add nodes to data walk( code, page.to_h, @data ) end |