Class: Omnium::Parser::AST::Number

Inherits:
Base
  • Object
show all
Defined in:
lib/omnium/parser/ast/number.rb

Overview

An integer node, which would accept an integer/number token.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Number

Returns a new instance of Number.



10
11
12
13
# File 'lib/omnium/parser/ast/number.rb', line 10

def initialize(token)
  @token = token # for convenience, though no getter for this
  @value = token.value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8
9
10
# File 'lib/omnium/parser/ast/number.rb', line 8

def value
  @value
end