Class: Lexer::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/special-giggle/lexer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string, type) ⇒ Token

Returns a new instance of Token.



7
8
9
# File 'lib/special-giggle/lexer.rb', line 7

def initialize(string, type)
  @string, @type = string, type
end

Instance Attribute Details

#stringObject (readonly)

Returns the value of attribute string.



5
6
7
# File 'lib/special-giggle/lexer.rb', line 5

def string
  @string
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/special-giggle/lexer.rb', line 5

def type
  @type
end