Class: GitDiff::LineNumber
- Inherits:
-
Object
- Object
- GitDiff::LineNumber
- Extended by:
- ClassMethods
- Defined in:
- lib/git_diff/line_number.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
- #increment ⇒ Object
- #increment_left ⇒ Object
- #increment_right ⇒ Object
-
#initialize(left, right) ⇒ LineNumber
constructor
A new instance of LineNumber.
- #pair ⇒ Object
Methods included from ClassMethods
for_addition, for_context, for_deletion
Constructor Details
#initialize(left, right) ⇒ LineNumber
Returns a new instance of LineNumber.
20 21 22 23 |
# File 'lib/git_diff/line_number.rb', line 20 def initialize(left, right) @left = left @right = right end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
3 4 5 |
# File 'lib/git_diff/line_number.rb', line 3 def left @left end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
3 4 5 |
# File 'lib/git_diff/line_number.rb', line 3 def right @right end |
Instance Method Details
#increment ⇒ Object
33 34 35 36 |
# File 'lib/git_diff/line_number.rb', line 33 def increment increment_left increment_right end |
#increment_left ⇒ Object
25 26 27 |
# File 'lib/git_diff/line_number.rb', line 25 def increment_left @left += 1 end |
#increment_right ⇒ Object
29 30 31 |
# File 'lib/git_diff/line_number.rb', line 29 def increment_right @right += 1 end |
#pair ⇒ Object
38 39 40 |
# File 'lib/git_diff/line_number.rb', line 38 def pair [left, right] end |