Skip to content

Instantly share code, notes, and snippets.

@flori
Created May 10, 2013 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flori/5554545 to your computer and use it in GitHub Desktop.
Save flori/5554545 to your computer and use it in GitHub Desktop.
class ::JSON::GenericObject
def self.load(source, proc = nil, opts = {})
result = ::JSON.load(source, proc, opts.merge(:object_class => ::JSON::GenericObject))
result.nil? ? ::JSON::GenericObject[] : result
end
def self.dump(obj, *args)
::JSON.dump(obj, *args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment