From: ko1@... Date: 2019-07-29T08:12:01+00:00 Subject: [ruby-core:93985] [Ruby master Feature#15917] Pattern matching for Struct Issue #15917 has been updated by ko1 (Koichi Sasada). Assignee set to ktsj (Kazuki Tsujimoto) ---------------------------------------- Feature #15917: Pattern matching for Struct https://bugs.ruby-lang.org/issues/15917#change-80179 * Author: marcandre (Marc-Andre Lafortune) * Status: Open * Priority: Normal * Assignee: ktsj (Kazuki Tsujimoto) * Target version: ---------------------------------------- `Struct`s 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" ``` -- https://bugs.ruby-lang.org/ Unsubscribe: