Class: Collie::AST::Location
- Inherits:
-
Object
- Object
- Collie::AST::Location
- Defined in:
- lib/collie/ast.rb
Overview
Location information for source code elements
Instance Attribute Summary collapse
-
#column ⇒ Object
Returns the value of attribute column.
-
#file ⇒ Object
Returns the value of attribute file.
-
#length ⇒ Object
Returns the value of attribute length.
-
#line ⇒ Object
Returns the value of attribute line.
Instance Method Summary collapse
-
#initialize(file:, line:, column:, length: 0) ⇒ Location
constructor
A new instance of Location.
- #to_s ⇒ Object
Constructor Details
#initialize(file:, line:, column:, length: 0) ⇒ Location
Returns a new instance of Location.
9 10 11 12 13 14 |
# File 'lib/collie/ast.rb', line 9 def initialize(file:, line:, column:, length: 0) @file = file @line = line @column = column @length = length end |
Instance Attribute Details
#column ⇒ Object
Returns the value of attribute column.
7 8 9 |
# File 'lib/collie/ast.rb', line 7 def column @column end |
#file ⇒ Object
Returns the value of attribute file.
7 8 9 |
# File 'lib/collie/ast.rb', line 7 def file @file end |
#length ⇒ Object
Returns the value of attribute length.
7 8 9 |
# File 'lib/collie/ast.rb', line 7 def length @length end |
#line ⇒ Object
Returns the value of attribute line.
7 8 9 |
# File 'lib/collie/ast.rb', line 7 def line @line end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/collie/ast.rb', line 16 def to_s "#{file}:#{line}:#{column}" end |