class Prism::RationalNode

^^^^
1.0r
Represents a rational number literal.

def self.type

Return a symbol representation of this node type. See `Node::type`.
def self.type
  :rational_node
end

def ===(other)

comparing the value of locations. Locations are checked only for presence.
Implements case-equality for the node. This is effectively == but without
def ===(other)
  other.is_a?(RationalNode) &&
    (flags === other.flags) &&
    (numerator === other.numerator) &&
    (denominator === other.denominator)
end

def accept(visitor)

def accept: (Visitor visitor) -> void
def accept(visitor)
  visitor.visit_rational_node(self)
end

def binary?

def binary?: () -> bool
def binary?
  flags.anybits?(IntegerBaseFlags::BINARY)
end

def child_nodes

def child_nodes: () -> Array[nil | Node]
def child_nodes
  []
end

def comment_targets

def comment_targets: () -> Array[Node | Location]
def comment_targets
  [] #: Array[Prism::node | Location]
end

def compact_child_nodes

def compact_child_nodes: () -> Array[Node]
def compact_child_nodes
  []
end

def copy(node_id: self.node_id, location: self.location, flags: self.flags, numerator: self.numerator, denominator: self.denominator)

def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?numerator: Integer, ?denominator: Integer) -> RationalNode
def copy(node_id: self.node_id, location: self.location, flags: self.flags, numerator: self.numerator, denominator: self.denominator)
  RationalNode.new(source, node_id, location, flags, numerator, denominator)
end

def decimal?

def decimal?: () -> bool
def decimal?
  flags.anybits?(IntegerBaseFlags::DECIMAL)
end

def deconstruct_keys(keys)

def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, numerator: Integer, denominator: Integer }
def deconstruct_keys(keys)
  { node_id: node_id, location: location, numerator: numerator, denominator: denominator }
end

def hexadecimal?

def hexadecimal?: () -> bool
def hexadecimal?
  flags.anybits?(IntegerBaseFlags::HEXADECIMAL)
end

def initialize(source, node_id, location, flags, numerator, denominator)

Initialize a new RationalNode node.
def initialize(source, node_id, location, flags, numerator, denominator)
  @source = source
  @node_id = node_id
  @location = location
  @flags = flags
  @numerator = numerator
  @denominator = denominator
end

def inspect

def inspect -> String
def inspect
  InspectVisitor.compose(self)
end

def numeric

method is deprecated in favor of #value or #numerator/#denominator.
Returns the value of the node as an IntegerNode or a FloatNode. This
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

def octal?

def octal?: () -> bool
def octal?
  flags.anybits?(IntegerBaseFlags::OCTAL)
end

def type

Return a symbol representation of this node type. See `Node#type`.
def type
  :rational_node
end

def value

Returns the value of the node as a Ruby Rational.
def value
  Rational(numerator, denominator)
end