method

jsonify

Importance_1
v5.1.7 - Show latest stable - 0 notes - Class: JSONGemEncoder
jsonify(value) private

Convert an object into a “JSON-ready” representation composed of primitives like Hash, Array, String, Numeric, and true/false/nil. Recursively calls #as_json to the object to recursively build a fully JSON-ready object.

This allows developers to implement #as_json without having to worry about what base types of objects they are allowed to return or having to remember to call #as_json recursively.

Note: the options hash passed to object.to_json is only passed to object.as_json, not any of this method’s recursive #as_json calls.

Show source
Register or log in to add new notes.