JP Camara @jpcamara.com · Nov 2

You can change the default return value of a hash by using `default=` on the hash. docs.ruby-lang.org/en/3.4/Hash..... Now instead of nil, you'll return whatever `default` you provided! Very handy. 7/11 🧵

0 likes 1 replies

?

Replies

JP Camara · Nov 2

`compare_by_identity` sets the hash to compare keys by their reference instead of their value. Not day-to-day useful but a fascinating option, and utilized nicely in Sidekiq 8/11 🧵