Class: Opted::Result::Match::Matcher
- Inherits:
-
Object
- Object
- Opted::Result::Match::Matcher
- Defined in:
- lib/opted/result/match.rb
Instance Method Summary collapse
-
#initialize(match) ⇒ Matcher
constructor
A new instance of Matcher.
- #match(&block) ⇒ Object
Constructor Details
#initialize(match) ⇒ Matcher
Returns a new instance of Matcher.
13 14 15 |
# File 'lib/opted/result/match.rb', line 13 def initialize(match) @match = match end |
Instance Method Details
#match(&block) ⇒ Object
17 18 19 20 21 |
# File 'lib/opted/result/match.rb', line 17 def match(&block) match = MatchWithBranchChecking.new(@match) match.instance_eval(&block) match.mapped_value_or_error end |