reverse_merge method
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.
Written by lazybios
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#