class Unparser::Emitter::Primitive::Rational

Emitter for rational literals

def dispatch

rubocop:disable Lint/FloatComparison
def dispatch
  integer = Integer(value)
  float   = value.to_f
  write_rational(integer.to_f.equal?(float) ? integer : float)
end

def write_rational(value)

def write_rational(value)
  write(value.to_s, RATIONAL_FORMAT)
end