Class: Origen::Utility::FileDiff::InputFile
- Defined in:
- lib/origen/utility/file_diff.rb
Instance Attribute Summary collapse
-
#pointer ⇒ Object
Returns the value of attribute pointer.
Instance Method Summary collapse
- #advance_pointer! ⇒ Object
- #current_line ⇒ Object
- #find_current_line_in(other) ⇒ Object
-
#initialize ⇒ InputFile
constructor
A new instance of InputFile.
Methods inherited from Array
#dups, #dups?, #dups_with_index, #ids, #include_hash?, #include_hash_with_key?
Constructor Details
#initialize ⇒ InputFile
Returns a new instance of InputFile.
7 8 9 |
# File 'lib/origen/utility/file_diff.rb', line 7 def initialize self.pointer = 0 end |
Instance Attribute Details
#pointer ⇒ Object
Returns the value of attribute pointer.
5 6 7 |
# File 'lib/origen/utility/file_diff.rb', line 5 def pointer @pointer end |
Instance Method Details
#advance_pointer! ⇒ Object
15 16 17 |
# File 'lib/origen/utility/file_diff.rb', line 15 def advance_pointer! self.pointer += 1 end |
#current_line ⇒ Object
11 12 13 |
# File 'lib/origen/utility/file_diff.rb', line 11 def current_line self[pointer] end |
#find_current_line_in(other) ⇒ Object
19 20 21 22 |
# File 'lib/origen/utility/file_diff.rb', line 19 def find_current_line_in(other) index = (other[other.pointer..-1] || []).index(current_line) index.nil? ? nil : other.pointer + index end |