Class: ArchSpec::SourceLocation
- Inherits:
-
Data
- Object
- Data
- ArchSpec::SourceLocation
- Defined in:
- lib/archspec/source_location.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#end_column ⇒ Object
readonly
Returns the value of attribute end_column.
-
#end_line ⇒ Object
readonly
Returns the value of attribute end_line.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
- .from_prism(path, location) ⇒ Object
-
.point(path, line, column) ⇒ Object
A zero-width location for diagnostics that point at a file rather than a span of code.
Instance Method Summary collapse
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column
6 7 8 |
# File 'lib/archspec/source_location.rb', line 6 def column @column end |
#end_column ⇒ Object (readonly)
Returns the value of attribute end_column
6 7 8 |
# File 'lib/archspec/source_location.rb', line 6 def end_column @end_column end |
#end_line ⇒ Object (readonly)
Returns the value of attribute end_line
6 7 8 |
# File 'lib/archspec/source_location.rb', line 6 def end_line @end_line end |
#line ⇒ Object (readonly)
Returns the value of attribute line
6 7 8 |
# File 'lib/archspec/source_location.rb', line 6 def line @line end |
#path ⇒ Object (readonly)
Returns the value of attribute path
6 7 8 |
# File 'lib/archspec/source_location.rb', line 6 def path @path end |
Class Method Details
.from_prism(path, location) ⇒ Object
7 8 9 |
# File 'lib/archspec/source_location.rb', line 7 def self.from_prism(path, location) new(path, location.start_line, location.start_column + 1, location.end_line, location.end_column + 1) end |
.point(path, line, column) ⇒ Object
A zero-width location for diagnostics that point at a file rather than a span of code.
13 14 15 |
# File 'lib/archspec/source_location.rb', line 13 def self.point(path, line, column) new(path, line, column, line, column) end |