Class: ActiveRecord::Coders::JSON
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | activerecord/lib/active_record/coders/json.rb |
Class Method Summary
- .new(options = {}) ⇒ JSON constructor
Instance Method Summary
Constructor Details
.new(options = {}) ⇒ JSON
# File 'activerecord/lib/active_record/coders/json.rb', line 6
def initialize( = {}) @options = end
Instance Method Details
#dump(obj)
[ GitHub ]# File 'activerecord/lib/active_record/coders/json.rb', line 10
def dump(obj) ActiveSupport::JSON.encode(obj) end
#load(json)
[ GitHub ]# File 'activerecord/lib/active_record/coders/json.rb', line 14
def load(json) ActiveSupport::JSON.decode(json, @options) unless json.blank? end