huginn/lib/json_with_indifferent_access.rb

9 lines
No EOL
186 B
Ruby

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