Hi everyone,
I have a subclass of File where I do some custom stuff in the constructor.
The short version is that the declaration looks something like this:
def initialize(alpha: true, beta: false, options: {})
# do stuff with alpha/beta
options[:mode] ||= 'wb+'
super(path, options)
end
In the past Ruby would convert the last positional hash to keyword
arguments. But with Ruby 3.0 this blows up.
What's the right way to declare this in a way that will work with both 2.x
and 3.x?
Regards,
Dan