Module: Either

Included in:
Left, Right
Defined in:
lib/either.rb,
lib/either/match.rb

Defined Under Namespace

Classes: Match

Instance Method Summary collapse

Instance Method Details

#match(&block) ⇒ Object



2
3
4
# File 'lib/either.rb', line 2

def match &block
  Match.new.tap { |m| block.call(m) }.evaluate(self)
end