123456789_123456789_123456789_123456789_123456789_

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

Instance Method Summary

Constructor Details

.new(options = {}) ⇒ JSON

[ GitHub ]

  
# File 'activerecord/lib/active_record/coders/json.rb', line 6

def initialize(options = {})
  @options = 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