Ruby's New Exception Keyword Arguments
In Ruby 2.6, a variety of Kernel methods get a new
exception: false
orexception: true
keyword argument. When Kernel methods fail, some raise an error and some just returnnil
. This new feature lets you override that default behavior.
Source: Ruby’s New Exception Keyword Arguments - Square Corner Blog - Medium
Nice. Especially good if you can exception: false
and use respond_to?
for better performance.