Class: Variable
- Inherits:
-
Object
- Object
- Variable
- Defined in:
- lib/mighty_json/variable.rb
Instance Method Summary collapse
- #cur ⇒ Object
-
#initialize ⇒ Variable
constructor
A new instance of Variable.
- #next ⇒ Object
Constructor Details
#initialize ⇒ Variable
Returns a new instance of Variable.
4 5 6 |
# File 'lib/mighty_json/variable.rb', line 4 def initialize @count = 0 end |
Instance Method Details
#cur ⇒ Object
13 14 15 |
# File 'lib/mighty_json/variable.rb', line 13 def cur "var#{@count}" end |
#next ⇒ Object
8 9 10 11 |
# File 'lib/mighty_json/variable.rb', line 8 def next @count += 1 cur end |