Class: FExpr::Evaluator::NumNode

Inherits:
Node
  • Object
show all
Defined in:
lib/fexpr/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#to_s, #x

Constructor Details

#initialize(val) ⇒ NumNode

Returns a new instance of NumNode.



77
78
79
# File 'lib/fexpr/base.rb', line 77

def initialize(val)
  @val = val
end

Instance Attribute Details

#valObject (readonly)

Returns the value of attribute val.



76
77
78
# File 'lib/fexpr/base.rb', line 76

def val
  @val
end

Instance Method Details

#evalObject



80
81
82
# File 'lib/fexpr/base.rb', line 80

def eval
  @val
end

#to_string(n) ⇒ Object



83
84
85
# File 'lib/fexpr/base.rb', line 83

def to_string(n)
  x(n) + @val.to_s
end