Class: Liquidscript::Scanner::Token
- Inherits:
-
Object
- Object
- Liquidscript::Scanner::Token
- Includes:
- Enumerable, ICR::Representable
- Defined in:
- lib/liquidscript/scanner/token.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(type, value, line, column) ⇒ Token
constructor
A new instance of Token.
- #to_a ⇒ Object
- #type?(type) ⇒ Boolean
Methods included from ICR::Representable
Constructor Details
#initialize(type, value, line, column) ⇒ Token
Returns a new instance of Token.
15 16 17 18 19 20 |
# File 'lib/liquidscript/scanner/token.rb', line 15 def initialize(type, value, line, column) @type = type @line = line @column = column @value = value end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
10 11 12 |
# File 'lib/liquidscript/scanner/token.rb', line 10 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
9 10 11 |
# File 'lib/liquidscript/scanner/token.rb', line 9 def line @line end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/liquidscript/scanner/token.rb', line 7 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
8 9 10 |
# File 'lib/liquidscript/scanner/token.rb', line 8 def value @value end |
Instance Method Details
#empty? ⇒ Boolean
30 31 32 |
# File 'lib/liquidscript/scanner/token.rb', line 30 def empty? false end |
#to_a ⇒ Object
22 23 24 |
# File 'lib/liquidscript/scanner/token.rb', line 22 def to_a [@type, @value] end |
#type?(type) ⇒ Boolean
26 27 28 |
# File 'lib/liquidscript/scanner/token.rb', line 26 def type?(type) @type == type end |