I have a method defined like this:
def woot(a = nil, b: nil)
...
end
What is the least ugly way to pass a Hash
instance to a
when b
is omitted?
I tried
woot(x: 1)
woot({x: 1})
h = {x: 1}
woot(h)
but they all raise
ArgumentError: unknown keyword: x
The only way to make the call that I have figured out is
woot({x: 1}, **{})
Is there a nicer way?