Class: TreeHaver::ByteEditSpan
- Inherits:
-
Struct
- Object
- Struct
- TreeHaver::ByteEditSpan
- Defined in:
- lib/tree_haver/contracts.rb
Instance Attribute Summary collapse
-
#new_end_byte ⇒ Object
Returns the value of attribute new_end_byte.
-
#new_end_point ⇒ Object
Returns the value of attribute new_end_point.
-
#old_end_byte ⇒ Object
Returns the value of attribute old_end_byte.
-
#old_end_point ⇒ Object
Returns the value of attribute old_end_point.
-
#start_byte ⇒ Object
Returns the value of attribute start_byte.
-
#start_point ⇒ Object
Returns the value of attribute start_point.
Instance Method Summary collapse
Instance Attribute Details
#new_end_byte ⇒ Object
Returns the value of attribute new_end_byte
742 743 744 |
# File 'lib/tree_haver/contracts.rb', line 742 def new_end_byte @new_end_byte end |
#new_end_point ⇒ Object
Returns the value of attribute new_end_point
742 743 744 |
# File 'lib/tree_haver/contracts.rb', line 742 def new_end_point @new_end_point end |
#old_end_byte ⇒ Object
Returns the value of attribute old_end_byte
742 743 744 |
# File 'lib/tree_haver/contracts.rb', line 742 def old_end_byte @old_end_byte end |
#old_end_point ⇒ Object
Returns the value of attribute old_end_point
742 743 744 |
# File 'lib/tree_haver/contracts.rb', line 742 def old_end_point @old_end_point end |
#start_byte ⇒ Object
Returns the value of attribute start_byte
742 743 744 |
# File 'lib/tree_haver/contracts.rb', line 742 def start_byte @start_byte end |
#start_point ⇒ Object
Returns the value of attribute start_point
742 743 744 |
# File 'lib/tree_haver/contracts.rb', line 742 def start_point @start_point end |
Instance Method Details
#byte_delta ⇒ Object
752 753 754 |
# File 'lib/tree_haver/contracts.rb', line 752 def byte_delta new_end_byte.to_i - old_end_byte.to_i end |
#new_range ⇒ Object
748 749 750 |
# File 'lib/tree_haver/contracts.rb', line 748 def new_range ByteRange.new(start_byte: start_byte, end_byte: new_end_byte) end |
#old_range ⇒ Object
744 745 746 |
# File 'lib/tree_haver/contracts.rb', line 744 def old_range ByteRange.new(start_byte: start_byte, end_byte: old_end_byte) end |
#to_h ⇒ Object
756 757 758 759 760 761 762 763 764 765 |
# File 'lib/tree_haver/contracts.rb', line 756 def to_h { start_byte: start_byte, old_end_byte: old_end_byte, new_end_byte: new_end_byte, start_point: start_point.to_h, old_end_point: old_end_point.to_h, new_end_point: new_end_point.to_h } end |