Method: Oj.mimic_JSON

Defined in:
ext/oj/oj.c

.mimic_JSONObject

Creates the JSON module with methods and classes to mimic the JSON gem. After this method is invoked calls that expect the JSON module will use Oj instead and be faster than the original JSON. Most options that could be passed to the JSON methods are supported. The calls to set parser or generator will not raise an Exception but will not have any effect. The method can also be called after the json gem is loaded. The necessary methods on the json gem will be replaced with Oj methods.

Note that this also sets the default options of :mode to :compat and :encoding to :ascii.

Returns [Module] the JSON module.



1320
# File 'ext/oj/oj.c', line 1320

extern VALUE  oj_define_mimic_json(int argc, VALUE *argv, VALUE self);