class Gracefully::Failure

Public Class Methods

new(error) click to toggle source
# File lib/gracefully/try.rb, line 57
def initialize(error)
  @error = error
end
with(error) click to toggle source
# File lib/gracefully/try.rb, line 53
def self.with(error)
  new error
end

Public Instance Methods

get() click to toggle source
# File lib/gracefully/try.rb, line 65
def get
  raise Error.new('Tried to get the value of a failure', nested: @error)
end
or_else(other) click to toggle source
# File lib/gracefully/try.rb, line 61
def or_else(other)
  other
end