Class: Odin::Parsing::Token
- Inherits:
-
Object
- Object
- Odin::Parsing::Token
- Defined in:
- lib/odin/parsing/token.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(type, value, line, column, raw: nil) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
Constructor Details
#initialize(type, value, line, column, raw: nil) ⇒ Token
Returns a new instance of Token.
8 9 10 11 12 13 14 15 |
# File 'lib/odin/parsing/token.rb', line 8 def initialize(type, value, line, column, raw: nil) @type = type @value = value @line = line @column = column @raw = raw freeze end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
6 7 8 |
# File 'lib/odin/parsing/token.rb', line 6 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
6 7 8 |
# File 'lib/odin/parsing/token.rb', line 6 def line @line end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
6 7 8 |
# File 'lib/odin/parsing/token.rb', line 6 def raw @raw end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/odin/parsing/token.rb', line 6 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/odin/parsing/token.rb', line 6 def value @value end |