Class: Wiris::Iterator

Inherits:
Enumerator
  • Object
show all
Defined in:
lib/src-generic/Iterator.rb

Instance Method Summary collapse

Constructor Details

#initialize(enum) ⇒ Iterator

Returns a new instance of Iterator.



4
5
6
# File 'lib/src-generic/Iterator.rb', line 4

def initialize(enum)
    @enumeration = enum.map
end

Instance Method Details

#hasNextObject



12
13
14
15
16
17
18
19
# File 'lib/src-generic/Iterator.rb', line 12

def hasNext()
    begin
        @enumeration.peek
        return true
    rescue StopIteration
        return false
    end
end

#nextObject



8
9
10
# File 'lib/src-generic/Iterator.rb', line 8

def next
    @enumeration.next
end