Class: Rucoa::Location
- Inherits:
-
Struct
- Object
- Struct
- Rucoa::Location
- Defined in:
- lib/rucoa/location.rb
Instance Attribute Summary collapse
-
#range ⇒ Object
Returns the value of attribute range.
-
#uri ⇒ Object
Returns the value of attribute uri.
Class Method Summary collapse
Instance Attribute Details
#range ⇒ Object
Returns the value of attribute range
4 5 6 |
# File 'lib/rucoa/location.rb', line 4 def range @range end |
#uri ⇒ Object
Returns the value of attribute uri
4 5 6 |
# File 'lib/rucoa/location.rb', line 4 def uri @uri end |
Class Method Details
.from_rbs_location(location) ⇒ Rucoa::Location
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rucoa/location.rb', line 12 def from_rbs_location(location) new( range: Range.new( Position.new( column: location.start_column, line: location.start_line ), Position.new( column: location.end_column, line: location.end_line ) ), uri: "file://#{location.name}" ) end |
.from_rucoa_node(node) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/rucoa/location.rb', line 29 def from_rucoa_node(node) new( range: Range.from_parser_range(node.location.expression), uri: node.location.expression.source_buffer.name ) end |