Module: Cuprum::Matching::ClassMethods
- Parent Namespace
- Cuprum::Matching
- Defined In
- lib/cuprum/matching.rb
Table Of Contents
Overview
Class methods extend-ed into a class when the module is included.
Back To Top
Instance Methods
#match(status, error: nil, value: nil, &block) => Object
Defines a match clause for the matcher.
Parameters
- status (Symbol) — The status to match. The clause will match a
result only if the result has the same status as the match clause.
- error (Class) — The type of error to match. If given, the clause
will match a result only if the result error is an instance of the
given class, or an instance of a subclass.
- value (Class) — The type of value to match. If given, the clause
will match a result only if the result value is an instance of the
given class, or an instance of a subclass.
Yields
- The code to execute on a successful match.
Yield Parameters
Back To Top
Back to
Documentation |
Versions |
1.3 |
Reference
|
Cuprum
|
Cuprum::Matching