Class: Natsuzora::Token
- Inherits:
-
Object
- Object
- Natsuzora::Token
- Defined in:
- lib/natsuzora/token.rb
Constant Summary collapse
- RESERVED_WORDS =
%w[if unless else each as in of unsecure true false null include].freeze
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type, value, line:, column:) ⇒ Token
constructor
A new instance of Token.
- #inspect ⇒ Object
Constructor Details
#initialize(type, value, line:, column:) ⇒ Token
Returns a new instance of Token.
9 10 11 12 13 14 |
# File 'lib/natsuzora/token.rb', line 9 def initialize(type, value, line:, column:) @type = type @value = value @line = line @column = column end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
5 6 7 |
# File 'lib/natsuzora/token.rb', line 5 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
5 6 7 |
# File 'lib/natsuzora/token.rb', line 5 def line @line end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/natsuzora/token.rb', line 5 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/natsuzora/token.rb', line 5 def value @value end |
Instance Method Details
#inspect ⇒ Object
16 17 18 |
# File 'lib/natsuzora/token.rb', line 16 def inspect "#<Token #{type}:#{value.inspect} at #{line}:#{column}>" end |