method

to_json

ruby latest stable - Class: Rational
to_json(*)
public

Stores class name (Rational) along with numerator value n and denominator value d as JSON string