Exception: DeferrableGratification::GuardFailed
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- DeferrableGratification::GuardFailed
- Defined in:
- lib/deferrable_gratification.rb
Overview
Exception passed to errbacks by Combinators#guard if the arguments to Deferrable#succeed fail the supplied predicate.
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(reason, args) ⇒ GuardFailed
constructor
A new instance of GuardFailed.
Constructor Details
#initialize(reason, args) ⇒ GuardFailed
Returns a new instance of GuardFailed.
28 29 30 31 32 |
# File 'lib/deferrable_gratification.rb', line 28 def initialize(reason, args) @reason = reason || 'guard failed' @args = args super("#{@args.inspect}: #{@reason}") end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
26 27 28 |
# File 'lib/deferrable_gratification.rb', line 26 def args @args end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
25 26 27 |
# File 'lib/deferrable_gratification.rb', line 25 def reason @reason end |