In Ruby 2.7, I can effectively deconstruct a hash in block parameters:
>> RUBY_VERSION
=> "2.7.6"
>> [{foo: 123}].each { |foo:| p foo }
123
=> [{:foo=>123}]
In Ruby 3.1, I can't:
>> RUBY_VERSION
=> "3.1.2"
>> [{foo: 123}].each { |foo:| p foo }
(irb):7:in `block in <top (required)>': missing keyword: :foo (ArgumentError)
It is possible to pattern match it outside the parameter list:
[{foo: 123}].each { |x| x => {foo:}; p foo }
But I'm after something in the parameter list, if possible.