Class: TreeStand::Range
- Inherits:
-
Object
- Object
- TreeStand::Range
- Extended by:
- T::Sig
- Defined in:
- lib/tree_stand/range.rb
Overview
Wrapper around a TreeSitter range. This is mainly used to compare ranges.
Defined Under Namespace
Classes: Point
Instance Attribute Summary collapse
- #end_byte ⇒ Integer readonly
- #end_point ⇒ TreeStand::Range::Point readonly
- #start_byte ⇒ Integer readonly
- #start_point ⇒ TreeStand::Range::Point readonly
Instance Method Summary collapse
- #==(other) ⇒ Boolean
- #initialize(start_byte:, end_byte:, start_point:, end_point:) ⇒ void constructor private
Constructor Details
#initialize(start_byte:, end_byte:, start_point:, end_point:) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 38 39 40 |
# File 'lib/tree_stand/range.rb', line 35 def initialize(start_byte:, end_byte:, start_point:, end_point:) @start_byte = start_byte @end_byte = end_byte @start_point = Point.new(start_point.row, start_point.column) @end_point = Point.new(end_point.row, end_point.column) end |
Instance Attribute Details
#end_byte ⇒ Integer (readonly)
20 21 22 |
# File 'lib/tree_stand/range.rb', line 20 def end_byte @end_byte end |
#end_point ⇒ TreeStand::Range::Point (readonly)
24 25 26 |
# File 'lib/tree_stand/range.rb', line 24 def end_point @end_point end |
#start_byte ⇒ Integer (readonly)
18 19 20 |
# File 'lib/tree_stand/range.rb', line 18 def start_byte @start_byte end |
#start_point ⇒ TreeStand::Range::Point (readonly)
22 23 24 |
# File 'lib/tree_stand/range.rb', line 22 def start_point @start_point end |