Sha256: 61746a12e6e39e1b7a8d90503e96c0de7672c3ada85fb437c769379f820ad0ac
Contents?: true
Size: 1.2 KB
Versions: 136
Compression:
Stored size: 1.2 KB
Contents
# Custom mode The `:custom` mode is the most configurable mode and honors almost all options. It provides the most flexibility although it can not be configured to be exactly like any of the other modes. Each mode has some special aspect that makes it unique. For example, the `:object` mode has it's own unique format for object dumping and loading. The `:compat` mode mimic the json gem including methods called for encoding and inconsistencies between `JSON.dump()`, `JSON.generate()`, and `JSON()`. The `:custom` mode is the default mode. It can be configured either by passing options to the `Oj.dump()` and `Oj.load()` methods or by modifying the default options. The ability to create objects from JSON object elements is supported and considers the `:create_additions` option. Special treatment is given to the `:create_id` though. If the `:create_id` is set to `"^o"` then the Oj internal encoding and decoding is used. These are more efficient than calling out to a `to_json` method or `create_json` method on the classes. Those method do not have to exist for the `"^o"` behavior to be utilized. Any other `:create_id` value behaves similar to the json gem by calling `to_json` and `create_json` as appropriate.
Version data entries
136 entries across 136 versions & 3 rubygems