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.
| 38 39 40 41 42 43 | # File 'lib/tree_stand/range.rb', line 38 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)
| 21 22 23 | # File 'lib/tree_stand/range.rb', line 21 def end_byte @end_byte end | 
#end_point ⇒ TreeStand::Range::Point (readonly)
| 27 28 29 | # File 'lib/tree_stand/range.rb', line 27 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)
| 24 25 26 | # File 'lib/tree_stand/range.rb', line 24 def start_point @start_point end |