Avoiding “NoMethodError” for nil in Ruby
How the safe navigation operator and the #dig method will change your life
One of my main frustrations as a junior Ruby developer was dealing with “NoMethodError” when there was a risk my object was nil. Ruby 2.3.0 introduced a…