Class: HQMF2JS::Generator::Counter
- Inherits:
-
Object
- Object
- HQMF2JS::Generator::Counter
- Defined in:
- lib/generator/js.rb
Overview
Simple class to issue monotonically increasing integer identifiers
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize ⇒ Counter
constructor
A new instance of Counter.
- #new_id ⇒ Object
Constructor Details
#initialize ⇒ Counter
Returns a new instance of Counter.
264 265 266 |
# File 'lib/generator/js.rb', line 264 def initialize @count = 0 end |
Instance Method Details
#new_id ⇒ Object
268 269 270 |
# File 'lib/generator/js.rb', line 268 def new_id @count+=1 end |