In Ruby versions older than 3.2, objects that respond to #to_hash are always used to extract keyword arguments from when **kwargs is present in a method signature. It causes these objects to be passed in as a hash to the raise method instead of an object.
Code like raise CustomError, object_implementing_to_hash, which relies on object_implementing_to_hash to be an object, no longer works.
In this commit we ensure above code keeps working until keyword arguments are fixed in Ruby 3.2.
In Ruby versions older than 3.2, objects that respond to
#to_hash
are always used to extract keyword arguments from when**kwargs
is present in a method signature. It causes these objects to be passed in as a hash to theraise
method instead of an object.Code like
raise CustomError, object_implementing_to_hash
, which relies onobject_implementing_to_hash
to be an object, no longer works.In this commit we ensure above code keeps working until keyword arguments are fixed in Ruby 3.2.