summaryrefslogtreecommitdiff
path: root/ext/json/lib/json/generic_object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/lib/json/generic_object.rb')
-rw-r--r--ext/json/lib/json/generic_object.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/json/lib/json/generic_object.rb b/ext/json/lib/json/generic_object.rb
index 8b1074c..8b8fd53 100644
--- a/ext/json/lib/json/generic_object.rb
+++ b/ext/json/lib/json/generic_object.rb
@@ -31,6 +31,15 @@ module JSON
object
end
end
+
+ def load(source, proc = nil, opts = {})
+ result = ::JSON.load(source, proc, opts.merge(:object_class => self))
+ result.nil? ? new : result
+ end
+
+ def dump(obj, *args)
+ ::JSON.dump(obj, *args)
+ end
end
self.json_creatable = false