Class: GitDiff::RangeInfo
- Inherits:
-
Object
- Object
- GitDiff::RangeInfo
- Extended by:
- ClassMethods
- Defined in:
- lib/git_diff/range_info.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#new_range ⇒ Object
readonly
Returns the value of attribute new_range.
-
#original_range ⇒ Object
readonly
Returns the value of attribute original_range.
Instance Method Summary collapse
-
#initialize(original_range, new_range, header) ⇒ RangeInfo
constructor
A new instance of RangeInfo.
- #to_s ⇒ Object
Methods included from ClassMethods
extract_hunk_range_data, from_string
Constructor Details
#initialize(original_range, new_range, header) ⇒ RangeInfo
Returns a new instance of RangeInfo.
20 21 22 23 24 |
# File 'lib/git_diff/range_info.rb', line 20 def initialize(original_range, new_range, header) @original_range = LineNumberRange.from_string(original_range) @new_range = LineNumberRange.from_string(new_range) @header = header.strip end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
5 6 7 |
# File 'lib/git_diff/range_info.rb', line 5 def header @header end |
#new_range ⇒ Object (readonly)
Returns the value of attribute new_range.
5 6 7 |
# File 'lib/git_diff/range_info.rb', line 5 def new_range @new_range end |
#original_range ⇒ Object (readonly)
Returns the value of attribute original_range.
5 6 7 |
# File 'lib/git_diff/range_info.rb', line 5 def original_range @original_range end |
Instance Method Details
#to_s ⇒ Object
26 27 28 |
# File 'lib/git_diff/range_info.rb', line 26 def to_s "@@ #{original_range.to_s(:-)} #{new_range.to_s(:+)} @@ #{header}".strip end |