Exception: DeferrableGratification::GuardFailed

Inherits:
RuntimeError
  • Object
show all
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)

Instance Method Summary (collapse)

Constructor Details

- (GuardFailed) initialize(reason, args)

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

- (Object) args (readonly)

Returns the value of attribute args



26
27
28
# File 'lib/deferrable_gratification.rb', line 26

def args
  @args
end

- (Object) reason (readonly)

Returns the value of attribute reason



25
26
27
# File 'lib/deferrable_gratification.rb', line 25

def reason
  @reason
end