Class: Hocon::Impl::ArrayIterator
- Inherits:
-
Object
- Object
- Hocon::Impl::ArrayIterator
- Defined in:
- lib/hocon/impl/array_iterator.rb
Instance Method Summary collapse
- #has_next? ⇒ Boolean
-
#initialize(a) ⇒ ArrayIterator
constructor
A new instance of ArrayIterator.
- #next ⇒ Object
Constructor Details
#initialize(a) ⇒ ArrayIterator
Returns a new instance of ArrayIterator.
6 7 8 9 |
# File 'lib/hocon/impl/array_iterator.rb', line 6 def initialize(a) @a = a @index = 0 end |
Instance Method Details
#has_next? ⇒ Boolean
11 12 13 |
# File 'lib/hocon/impl/array_iterator.rb', line 11 def has_next? @index < @a.length end |
#next ⇒ Object
15 16 17 18 |
# File 'lib/hocon/impl/array_iterator.rb', line 15 def next @index += 1 @a[@index - 1] end |