Class: Factbook::Counter

Inherits:
Object
  • Object
show all
Defined in:
lib/factbook-readers/counter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCounter

Returns a new instance of Counter.



8
9
10
# File 'lib/factbook-readers/counter.rb', line 8

def initialize
  @data = {}
end

Instance Attribute Details

#dataObject (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