Class: Wiris::Iterator
- Inherits:
-
Enumerator
- Object
- Enumerator
- Wiris::Iterator
- Defined in:
- lib/src-generic/Iterator.rb
Instance Method Summary collapse
- #hasNext ⇒ Object
-
#initialize(enum) ⇒ Iterator
constructor
A new instance of Iterator.
- #next ⇒ Object
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
#hasNext ⇒ Object
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 |
#next ⇒ Object
8 9 10 |
# File 'lib/src-generic/Iterator.rb', line 8 def next @enumeration.next end |