Class: Cambridge::Tokens::Number

Inherits:
Base
  • Object
show all
Defined in:
lib/cambridge/tokens/number.rb

Instance Method Summary collapse

Methods inherited from Base

#de_codepoint

Constructor Details

#initialize(string) ⇒ Number

Returns a new instance of Number.



4
5
6
# File 'lib/cambridge/tokens/number.rb', line 4

def initialize(string)
  @number = de_codepoint(string).to_i
end

Instance Method Details

#to_rubyObject



8
9
10
# File 'lib/cambridge/tokens/number.rb', line 8

def to_ruby
  "@stack.push #{@number.to_s}"
end