Exception: Gold::Outcomes::Failure

Inherits:
Outcome
  • Object
show all
Defined in:
lib/gold/outcomes.rb

Overview

General failure class

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Outcome

#ok?

Constructor Details

#initialize(reason = nil, message = nil) ⇒ Failure

Returns a new instance of Failure.



23
24
25
26
# File 'lib/gold/outcomes.rb', line 23

def initialize(reason = nil, message = nil)
  @reason = reason
  super(false, message || reason)
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



21
22
23
# File 'lib/gold/outcomes.rb', line 21

def reason
  @reason
end