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.



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

def initialize
  @data = {}
end

Instance Attribute Details

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