class Kind::Either::Monad::Wrapper

Public Instance Methods

left(matcher = UNDEFINED) { |value| ... } click to toggle source
# File lib/kind/either/monad/wrapper.rb, line 7
def left(matcher = UNDEFINED)
  return if @monad.right? || output?

  @output = yield(@monad.value) if @monad.either?(matcher)
end
right(matcher = UNDEFINED) { |value| ... } click to toggle source
# File lib/kind/either/monad/wrapper.rb, line 13
def right(matcher = UNDEFINED)
  return if @monad.left? || output?

  @output = yield(@monad.value) if @monad.either?(matcher)
end