Class: Gedcomx::Iterator
- Inherits:
-
Object
- Object
- Gedcomx::Iterator
- Defined in:
- lib/gedcomx/iterator.rb
Instance Method Summary collapse
- #done? ⇒ Boolean
- #has_next? ⇒ Boolean
-
#initialize(input) ⇒ Iterator
constructor
A new instance of Iterator.
- #next ⇒ Object
- #to_java ⇒ Object
Constructor Details
#initialize(input) ⇒ Iterator
Returns a new instance of Iterator.
4 5 6 7 8 9 |
# File 'lib/gedcomx/iterator.rb', line 4 def initialize(input) unless File.file?(input) input = Gedcomx.input_stream(input) end @iter = org.gedcomx.util.RecordSetIterator.new(input) end |
Instance Method Details
#done? ⇒ Boolean
15 16 17 |
# File 'lib/gedcomx/iterator.rb', line 15 def done? !@iter.hasNext end |
#has_next? ⇒ Boolean
11 12 13 |
# File 'lib/gedcomx/iterator.rb', line 11 def has_next? @iter.hasNext end |
#next ⇒ Object
19 20 21 |
# File 'lib/gedcomx/iterator.rb', line 19 def next Record.new(@iter.next) end |
#to_java ⇒ Object
23 24 25 |
# File 'lib/gedcomx/iterator.rb', line 23 def to_java @iter end |