Class
Instance Methods
#
lib/prism/node_ext.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/prism/node_ext.rb, line 120
def numeric
deprecated("value", "numerator", "denominator")
if denominator == 1
IntegerNode.new(source, -1, location.chop, flags, numerator)
else
FloatNode.new(source, -1, location.chop, 0, numerator.to_f / denominator)
end
end
Returns the value of the node as an IntegerNode or a FloatNode. This method is deprecated in favor of value
or numerator/#denominator.
#
lib/prism/node_ext.rb
View on GitHub
# File tmp/rubies/ruby-master/lib/prism/node_ext.rb, line 114
def value
Rational(numerator, denominator)
end
Returns the value of the node as a Ruby Rational
.