Class: Opted::Result::Match::Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/opted/result/match.rb

Instance Method Summary collapse

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