class Unparser::Either

def self.wrap_error(*exceptions)

Returns:
  • (Either) -

Parameters:
  • exception (Class) --
def self.wrap_error(*exceptions)
  Right.new(yield)
rescue *exceptions => error
  Left.new(error)
end

def left?

Returns:
  • (Boolean) -
def left?
  instance_of?(Left)
end

def right?

Returns:
  • (Boolean) -
def right?
  instance_of?(Right)
end