Method: Fear::PatternMatchingApi#case
- Defined in:
- lib/fear/pattern_matching_api.rb
#case(*guards, &function) ⇒ Fear::PartialFunction
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Note:
to make more complex matches, you are encouraged to use Qo gem.
Creates partial function defined on domain described with guards
105 106 107 |
# File 'lib/fear/pattern_matching_api.rb', line 105 def case(*guards, &function) PartialFunction.and(*guards, &function) end |