Class: BigDecimal (Ruby 2.3.4)

BigDecimal

Public Class Methods

json_create(object)

Import a JSON Marshalled object.

method used for JSON marshalling support.

 
               # File json/lib/json/add/bigdecimal.rb, line 11
def self.json_create(object)
  BigDecimal._load object['b']
end
            

Public Instance Methods

as_json(*)

Marshal the object to JSON.

method used for JSON marshalling support.

 
               # File json/lib/json/add/bigdecimal.rb, line 18
def as_json(*)
  {
    JSON.create_id => self.class.name,
    'b'            => _dump,
  }
end
            
to_json(*)

return the JSON value

 
               # File json/lib/json/add/bigdecimal.rb, line 26
def to_json(*)
  as_json.to_json
end