sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

ActiveSupport::JSON::Encoding::JSONGemEncoder#jsonify

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.

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/json/encoding.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-ActiveSupport--JSON--Encoding--JSONGemEncoder-jsonify-for-pr


# Commit to git

git add app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/json/encoding.rbgit commit -m "better docs for ActiveSupport::JSON::Encoding::JSONGemEncoder#jsonify"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-ActiveSupport--JSON--Encoding--JSONGemEncoder-jsonify-for-pr

hub pull-request


# Celebrate!