Class: Klam::ConstantGenerator
- Inherits:
-
Object
- Object
- Klam::ConstantGenerator
- Defined in:
- lib/klam/constant_generator.rb
Instance Method Summary collapse
-
#initialize ⇒ ConstantGenerator
constructor
A new instance of ConstantGenerator.
- #next ⇒ Object
Constructor Details
#initialize ⇒ ConstantGenerator
Returns a new instance of ConstantGenerator.
3 4 5 |
# File 'lib/klam/constant_generator.rb', line 3 def initialize @index = 0 end |
Instance Method Details
#next ⇒ Object
7 8 9 10 |
# File 'lib/klam/constant_generator.rb', line 7 def next @index += 1 Klam::Constant.new('__KLAMC_%03d' % @index) end |