Class: Twostroke::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/twostroke/lexer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#colObject

Returns the value of attribute col.



6
7
8
# File 'lib/twostroke/lexer.rb', line 6

def col
  @col
end

#lineObject

Returns the value of attribute line.



6
7
8
# File 'lib/twostroke/lexer.rb', line 6

def line
  @line
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/twostroke/lexer.rb', line 6

def type
  @type
end

#valObject

Returns the value of attribute val.



6
7
8
# File 'lib/twostroke/lexer.rb', line 6

def val
  @val
end