Class: Ruby::Token
- Includes:
- Conversions::Token
- Defined in:
- lib/ruby/token.rb
Direct Known Subclasses
Char, False, Float, HeredocBegin, Identifier, Integer, Keyword, Label, Nil, StringContent, True, Variable, Whitespace
Instance Attribute Summary collapse
-
#position(prolog = false) ⇒ Object
Returns the value of attribute position.
-
#prolog ⇒ Object
Returns the value of attribute prolog.
-
#token ⇒ Object
Returns the value of attribute token.
Attributes included from Node::Composite
Instance Method Summary collapse
-
#initialize(token = '', position = nil, prolog = nil) ⇒ Token
constructor
A new instance of Token.
- #to_ruby(prolog = false) ⇒ Object
- #to_s ⇒ Object
Methods included from Conversions::Token
#to_identifier, #to_string_content
Methods inherited from Node
#<=>, #all_nodes, #column, #length, #nodes, #row
Methods included from Conversions
Methods included from Node::Traversal
#has_token?, #has_type?, #has_value?, #is_instance_of?, #left_of?, #matches?, #position?, #right_of?, #select
Methods included from Node::Source
#context, #filename, #line, #lines, #src
Methods included from Node::Composite
Constructor Details
Instance Attribute Details
#position(prolog = false) ⇒ Object
Returns the value of attribute position.
7 8 9 |
# File 'lib/ruby/token.rb', line 7 def position @position end |
#prolog ⇒ Object
Returns the value of attribute prolog.
7 8 9 |
# File 'lib/ruby/token.rb', line 7 def prolog @prolog end |
#token ⇒ Object
Returns the value of attribute token.
7 8 9 |
# File 'lib/ruby/token.rb', line 7 def token @token end |