Class: Prism::RationalNode

Inherits:
Node
  • Object
show all
Defined in:
lib/prism/node_ext.rb

Instance Method Summary collapse

Instance Method Details

#valueObject

Returns the value of the node as a Ruby Rational.



83
84
85
# File 'lib/prism/node_ext.rb', line 83

def value
  Rational(numeric.is_a?(IntegerNode) ? numeric.value : slice.chomp("r"))
end