Method: Oj.remove_to_json

Defined in:
ext/oj/oj.c

.remove_to_jsonObject

Reverts back to the to_s dump behavior in :compat mode to instead use an optimized dump that includes the classname and attributes so that the object can be re-created on load. The format is the same as the json gem but does not use the ruby methods for encoding.

The classes supported for optimization are: Array, BigDecimal, Complex, Date, DateTime, Exception, Hash, Integer, OpenStruct, Range, Rational, Regexp, Struct, and Time. Providing no classes will result in all those classes being reverted from the optimized mode.

  • args [Class] zero or more classes to optimize.

[View source]

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

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