Class: Arboretum::DocTree::Counters::Incrementer

Inherits:
Object
  • Object
show all
Defined in:
lib/arboretum/doctree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Incrementer

Returns a new instance of Incrementer.



41
42
43
44
45
# File 'lib/arboretum/doctree.rb', line 41

def initialize(name)
  @name = name
  @value = 0
  Counter.counters[name].incrementers << self
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



38
39
40
# File 'lib/arboretum/doctree.rb', line 38

def name
  @name
end

#valueObject

Returns the value of attribute value.



39
40
41
# File 'lib/arboretum/doctree.rb', line 39

def value
  @value
end

Instance Method Details

#counterObject



47
48
49
# File 'lib/arboretum/doctree.rb', line 47

def counter
  Counter.counters[@name]
end