Top Level Namespace

Defined Under Namespace

Modules: JSON, Oj, Oj.optimize_rails(), mimic_JSON Classes: DateTime, String

Instance Method Summary collapse

Instance Method Details

#remove_to_json(*args) ⇒ Object

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.