sonic-pi

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

C++

Code. Music. Live.

Hash#nested_under_indifferent_access

Returns an <tt>ActiveSupport::HashWithIndifferentAccess</tt> out of its receiver:

  { a: 1 }.with_indifferent_access['a'] # => 1
Called when object is nested under an object that receives
#with_indifferent_access. This method will be called on the current object
by the enclosing object and is aliased to #with_indifferent_access by
default. Subclasses of Hash may overwrite this method to return +self+ if
converting to an <tt>ActiveSupport::HashWithIndifferentAccess</tt> would not be
desirable.

  b = { b: 1 }
  { a: b }.with_indifferent_access['a'] # calls b.nested_under_indifferent_access
  # => {"b"=>32}

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/core_ext/hash/indifferent_access.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Hash-nested_under_indifferent_access-for-pr


# Commit to git

git add app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/hash/indifferent_access.rbgit commit -m "better docs for Hash#nested_under_indifferent_access"


# Open pull request

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

hub fork

git push <your name> -your-name--update-docs-Hash-nested_under_indifferent_access-for-pr

hub pull-request


# Celebrate!