Actions
Feature #19232
closedadd NoMatchingPatternError#matchee
Status:
Feedback
Assignee:
-
Target version:
-
Description
currently if you pattern match a Hash, you can inspect the #key and #matchee methods from the NoMatchingPatternKeyError
begin
{ error: true } => { value: }
rescue NoMatchingPatternKeyError => e
e.matchee
end
# => {:error=>true}
I would find it very helpful for this functionality to be available for the standard NoMatchingPatternError
without hash key matching
proposed:
begin
[:error, "message"] => [:ok, value]
rescue NoMatchingPatternError => e
e.matchee
end
# => [:error, "message"]
Updated by ktsj (Kazuki Tsujimoto) almost 2 years ago
- Status changed from Open to Feedback
Do you have any real use case for this?
Actions
Like0
Like0