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.
335 336 337 |
# File 'lib/generator/js.rb', line 335 def initialize @count = 0 end |
Instance Method Details
#new_id ⇒ Object
339 340 341 |
# File 'lib/generator/js.rb', line 339 def new_id @count+=1 end |