Class: Twostroke::Token
- Inherits:
-
Object
- Object
- Twostroke::Token
- Defined in:
- lib/twostroke/lexer.rb
Instance Attribute Summary collapse
-
#col ⇒ Object
Returns the value of attribute col.
-
#line ⇒ Object
Returns the value of attribute line.
-
#type ⇒ Object
Returns the value of attribute type.
-
#val ⇒ Object
Returns the value of attribute val.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize(hash = {}) ⇒ Token
Returns a new instance of Token.
7 8 9 10 11 |
# File 'lib/twostroke/lexer.rb', line 7 def initialize(hash = {}) hash.each do |k,v| send "#{k}=", v end end |
Instance Attribute Details
#col ⇒ Object
Returns the value of attribute col.
6 7 8 |
# File 'lib/twostroke/lexer.rb', line 6 def col @col end |
#line ⇒ Object
Returns the value of attribute line.
6 7 8 |
# File 'lib/twostroke/lexer.rb', line 6 def line @line end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/twostroke/lexer.rb', line 6 def type @type end |
#val ⇒ Object
Returns the value of attribute val.
6 7 8 |
# File 'lib/twostroke/lexer.rb', line 6 def val @val end |