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
140 141 142 |
# File 'lib/tree_haver/contracts.rb', line 140 def new_end_byte @new_end_byte end |
#new_end_point ⇒ Object
Returns the value of attribute new_end_point
140 141 142 |
# File 'lib/tree_haver/contracts.rb', line 140 def new_end_point @new_end_point end |
#old_end_byte ⇒ Object
Returns the value of attribute old_end_byte
140 141 142 |
# File 'lib/tree_haver/contracts.rb', line 140 def old_end_byte @old_end_byte end |
#old_end_point ⇒ Object
Returns the value of attribute old_end_point
140 141 142 |
# File 'lib/tree_haver/contracts.rb', line 140 def old_end_point @old_end_point end |
#start_byte ⇒ Object
Returns the value of attribute start_byte
140 141 142 |
# File 'lib/tree_haver/contracts.rb', line 140 def start_byte @start_byte end |
#start_point ⇒ Object
Returns the value of attribute start_point
140 141 142 |
# File 'lib/tree_haver/contracts.rb', line 140 def start_point @start_point end |
Instance Method Details
#byte_delta ⇒ Object
149 150 151 |
# File 'lib/tree_haver/contracts.rb', line 149 def byte_delta new_end_byte.to_i - old_end_byte.to_i end |
#new_range ⇒ Object
145 146 147 |
# File 'lib/tree_haver/contracts.rb', line 145 def new_range ByteRange.new(start_byte: start_byte, end_byte: new_end_byte) end |
#old_range ⇒ Object
141 142 143 |
# File 'lib/tree_haver/contracts.rb', line 141 def old_range ByteRange.new(start_byte: start_byte, end_byte: old_end_byte) end |
#to_h ⇒ Object
153 154 155 156 157 158 159 160 161 162 |
# File 'lib/tree_haver/contracts.rb', line 153 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 |