Class: Chem::G98::Lines
- Inherits:
-
Object
- Object
- Chem::G98::Lines
- Defined in:
- lib/chem/db/g98.rb
Instance Method Summary collapse
- #eof? ⇒ Boolean
-
#initialize(lines_array) ⇒ Lines
constructor
A new instance of Lines.
- #next_line ⇒ Object
- #now ⇒ Object
- #proceed(num = 1) ⇒ Object
Constructor Details
#initialize(lines_array) ⇒ Lines
Returns a new instance of Lines.
8 9 10 11 |
# File 'lib/chem/db/g98.rb', line 8 def initialize lines_array @lines = lines_array @line_ptr = 0 end |
Instance Method Details
#eof? ⇒ Boolean
22 23 24 |
# File 'lib/chem/db/g98.rb', line 22 def eof? @lines.length == @line_ptr end |
#next_line ⇒ Object
12 13 14 |
# File 'lib/chem/db/g98.rb', line 12 def next_line @lines[@line_ptr + 1] end |
#now ⇒ Object
19 20 21 |
# File 'lib/chem/db/g98.rb', line 19 def now @lines[@line_ptr] end |
#proceed(num = 1) ⇒ Object
15 16 17 18 |
# File 'lib/chem/db/g98.rb', line 15 def proceed num = 1 @line_ptr = @line_ptr + num raise if @line_ptr > @lines.length end |