class Opted::Result::Match::MatchWithBranchChecking

Public Class Methods

new(match) click to toggle source
# File lib/opted/result/match.rb, line 53
def initialize(match)
  @match = match
end

Public Instance Methods

err(&block) click to toggle source
# File lib/opted/result/match.rb, line 62
def err(&block)
  @err_called = true
  @match.err(&block)
end
mapped_value_or_error() click to toggle source
# File lib/opted/result/match.rb, line 67
def mapped_value_or_error
  if @ok_called && @err_called
    @match.mapped_value_or_error
  else
    fail "Must match on both ok and err results"
  end
end
ok(&block) click to toggle source
# File lib/opted/result/match.rb, line 57
def ok(&block)
  @ok_called = true
  @match.ok(&block)
end