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
permalink #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
Instance Method Details
permalink #advance_pointer! ⇒ Object
[View source]
15 16 17 |
# File 'lib/origen/utility/file_diff.rb', line 15 def advance_pointer! self.pointer += 1 end |
permalink #current_line ⇒ Object
[View source]
11 12 13 |
# File 'lib/origen/utility/file_diff.rb', line 11 def current_line self[pointer] end |
permalink #find_current_line_in(other) ⇒ Object
[View source]
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 |