Parent

Files

Rational

Public Class Methods

json_create(object) click to toggle source
   # File lib/json/add/rational.rb, line 7
7:   def self.json_create(object)
8:     Rational(object['n'], object['d'])
9:   end

Public Instance Methods

as_json(*) click to toggle source
    # File lib/json/add/rational.rb, line 11
11:   def as_json(*)
12:     {
13:       JSON.create_id => self.class.name,
14:       'n'            => numerator,
15:       'd'            => denominator,
16:     }
17:   end
to_json(*) click to toggle source
    # File lib/json/add/rational.rb, line 19
19:   def to_json(*)
20:     as_json.to_json
21:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.