class Concurrent::Maybe

def self.nothing(error = '')

Returns:
  • (Maybe) - The newly created object.

Parameters:
  • error (Exception) -- The reason to set for the new `Maybe` object.
def self.nothing(error = '')
  if error.is_a?(Exception)
    nothing = error
  else
    nothing = StandardError.new(error.to_s)
  end
  return new(NONE, nothing)
end