Actions
Feature #15917
closedPattern matching for Struct
Feature #15917:
Pattern matching for Struct
Description
Structs respond to deconstruct, not to deconstruct_keys. Shouldn't we also implement it?
A = Struct.new(:foo, :bar)
case A.new(1, 2)
in foo: 1, **rest
p "match"
else
p "no match"
end
# => "no match", should be "match"
Actions