Class: HQMF::InstanceCounter

Inherits:
Object
  • Object
show all
Defined in:
lib/util/counter.rb

Overview

Simple class to issue monotonically increasing integer identifiers

Direct Known Subclasses

Counter

Instance Method Summary collapse

Constructor Details

#initializeInstanceCounter

Returns a new instance of InstanceCounter.



4
5
6
# File 'lib/util/counter.rb', line 4

def initialize
  @count=0
end

Instance Method Details

#nextObject



12
13
14
# File 'lib/util/counter.rb', line 12

def next
  @count+=1
end

#resetObject



8
9
10
# File 'lib/util/counter.rb', line 8

def reset
  @count=0
end