1
0

json_with_indifferent_access.rb 187 B

123456789
  1. class JSONWithIndifferentAccess
  2. def self.load(json)
  3. ActiveSupport::HashWithIndifferentAccess.new(JSON.parse(json || '{}'))
  4. end
  5. def self.dump(hash)
  6. JSON.dump(hash)
  7. end
  8. end