Class: Hocon::Impl::ArrayIterator

Inherits:
Object
  • Object
show all
Defined in:
lib/hocon/impl/array_iterator.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


11
12
13
# File 'lib/hocon/impl/array_iterator.rb', line 11

def has_next?
  @index < @a.length
end

#nextObject



15
16
17
18
# File 'lib/hocon/impl/array_iterator.rb', line 15

def next
  @index += 1
  @a[@index - 1]
end