Class: Qo::PatternMatchers::ResultPatternMatch
- Inherits:
-
PatternMatch
- Object
- PatternMatch
- Qo::PatternMatchers::ResultPatternMatch
- Defined in:
- lib/qo/pattern_matchers/result_pattern_match.rb
Overview
Unlike the normal pattern matcher, this one works on tuple arrays containing
a status and a result like [:ok, result]
and [:err, message]
.
Note that each of these can still take conditionals much like a where
branch for more fine grained control over what we're looking for.
Instance Method Summary collapse
-
#initialize(destructure: false) ⇒ type
constructor
Creates a new result matcher.
Methods inherited from PatternMatch
#call, create, mixin, #to_proc
Methods included from Branching
Constructor Details
#initialize(destructure: false) ⇒ type
Creates a new result matcher
40 41 42 |
# File 'lib/qo/pattern_matchers/result_pattern_match.rb', line 40 def initialize(destructure: false) super(destructure: destructure) end |