sonic-pi

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

C++

Code. Music. Live.

Hash#reverse_merge

Merges the caller into +other_hash+. For example,

  options = options.reverse_merge(size: 25, velocity: 10)

is equivalent to

  options = { size: 25, velocity: 10 }.merge(options)

This is particularly useful for initializing an options hash
with default values.

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/reverse_merge.rb

Contribute

# Make a new branch

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


# Commit to git

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


# 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-reverse_merge-for-pr

hub pull-request


# Celebrate!