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"]
Actions
Like0
Like0