Exception: Amigo::Retry::OrDie
- Defined in:
- lib/amigo/retry.rb
Overview
Raise this class, or a subclass of it, to:
-
Use
Retry
exception semantics while the current attempt is <=attempts
, or -
Use
Die
exception semantics if the current attempt is >attempts
.
Instance Attribute Summary collapse
-
#attempts ⇒ Object
readonly
Returns the value of attribute attempts.
-
#interval_or_timestamp ⇒ Object
readonly
Returns the value of attribute interval_or_timestamp.
Instance Method Summary collapse
-
#initialize(attempts, interval_or_timestamp, msg = nil) ⇒ OrDie
constructor
A new instance of OrDie.
Constructor Details
#initialize(attempts, interval_or_timestamp, msg = nil) ⇒ OrDie
Returns a new instance of OrDie.
48 49 50 51 52 |
# File 'lib/amigo/retry.rb', line 48 def initialize(attempts, , msg=nil) @attempts = attempts @interval_or_timestamp = super(msg || "retry every #{} up to #{attempts} times") end |
Instance Attribute Details
#attempts ⇒ Object (readonly)
Returns the value of attribute attempts.
46 47 48 |
# File 'lib/amigo/retry.rb', line 46 def attempts @attempts end |
#interval_or_timestamp ⇒ Object (readonly)
Returns the value of attribute interval_or_timestamp.
46 47 48 |
# File 'lib/amigo/retry.rb', line 46 def @interval_or_timestamp end |