Class: HQMF::InstanceCounter
- Inherits:
-
Object
- Object
- HQMF::InstanceCounter
- Defined in:
- lib/util/counter.rb
Overview
Simple class to issue monotonically increasing integer identifiers
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize ⇒ InstanceCounter
constructor
A new instance of InstanceCounter.
- #next ⇒ Object
- #reset ⇒ Object
Constructor Details
#initialize ⇒ InstanceCounter
Returns a new instance of InstanceCounter.
4 5 6 |
# File 'lib/util/counter.rb', line 4 def initialize @count=0 end |
Instance Method Details
#next ⇒ Object
12 13 14 |
# File 'lib/util/counter.rb', line 12 def next @count+=1 end |
#reset ⇒ Object
8 9 10 |
# File 'lib/util/counter.rb', line 8 def reset @count=0 end |