Module: Deterministic::PatternMatching
- Included in:
- Either
- Defined in:
- lib/deterministic/either/match.rb
Defined Under Namespace
Classes: Match, NoMatchError
Instance Method Summary
collapse
Instance Method Details
#match(proc = nil, &block) ⇒ Object
3
4
5
6
7
|
# File 'lib/deterministic/either/match.rb', line 3
def match(proc=nil, &block)
match = Match.new(self)
match.instance_eval &(proc || block)
match.result
end
|