huginn/lib/json_with_indifferent_access.rb

9 lines
187 B
Ruby
Raw Normal View History

class JSONWithIndifferentAccess
def self.load(json)
ActiveSupport::HashWithIndifferentAccess.new(JSON.parse(json || '{}'))
end
def self.dump(hash)
JSON.dump(hash)
end
end