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.
22 23 24 25 |
# File 'lib/git_diff/line_number.rb', line 22 def initialize(left, right) @left = left @right = right end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
5 6 7 |
# File 'lib/git_diff/line_number.rb', line 5 def left @left end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
5 6 7 |
# File 'lib/git_diff/line_number.rb', line 5 def right @right end |
Instance Method Details
#increment ⇒ Object
35 36 37 38 |
# File 'lib/git_diff/line_number.rb', line 35 def increment increment_left increment_right end |
#increment_left ⇒ Object
27 28 29 |
# File 'lib/git_diff/line_number.rb', line 27 def increment_left @left += 1 end |
#increment_right ⇒ Object
31 32 33 |
# File 'lib/git_diff/line_number.rb', line 31 def increment_right @right += 1 end |
#pair ⇒ Object
40 41 42 |
# File 'lib/git_diff/line_number.rb', line 40 def pair [left, right] end |