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 ⇒ Object
readonly
Returns the value of attribute end_byte.
-
#end_point ⇒ Object
readonly
Returns the value of attribute end_point.
-
#start_byte ⇒ Object
readonly
Returns the value of attribute start_byte.
-
#start_point ⇒ Object
readonly
Returns the value of attribute start_point.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(start_byte:, end_byte:, start_point:, end_point:) ⇒ Range
constructor
A new instance of Range.
Constructor Details
#initialize(start_byte:, end_byte:, start_point:, end_point:) ⇒ Range
Returns a new instance of Range.
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 ⇒ Object (readonly)
Returns the value of attribute end_byte.
21 22 23 |
# File 'lib/tree_stand/range.rb', line 21 def end_byte @end_byte end |
#end_point ⇒ Object (readonly)
Returns the value of attribute end_point.
27 28 29 |
# File 'lib/tree_stand/range.rb', line 27 def end_point @end_point end |
#start_byte ⇒ Object (readonly)
Returns the value of attribute start_byte.
18 19 20 |
# File 'lib/tree_stand/range.rb', line 18 def start_byte @start_byte end |
#start_point ⇒ Object (readonly)
Returns the value of attribute start_point.
24 25 26 |
# File 'lib/tree_stand/range.rb', line 24 def start_point @start_point end |