class Calcula::Exprs::NumExpr
Expression for representing real numbers
@author Paul T.
Public Class Methods
new(num)
click to toggle source
@param num [Calcula::Token] The token should have the type of NUM
# File lib/Exprs/NumExpr.rb, line 9 def initialize(num) @num = num end
Public Instance Methods
children()
click to toggle source
@see Calcula::Expr#children
@param (see Calcula::Expr#children
) @return (see Calcula::Expr#children
)
# File lib/Exprs/NumExpr.rb, line 32 def children [] end
to_s(form: :src)
click to toggle source
@see Calcula::Expr#to_s
@param (see Calcula::Expr#to_s
) @return (see Calcula::Expr#to_s
)
# File lib/Exprs/NumExpr.rb, line 16 def to_s(form: :src) case form when :src then @num.text when :tree then "(num #{@num.text})" when :ruby then "#{@num.text}r" else nil end end