method
jsonify
v4.2.7 -
Show latest stable
- Class:
ActiveSupport::JSON::Encoding::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.