Class: Rhod::Backoffs::Backoff
- Inherits:
-
Object
- Object
- Rhod::Backoffs::Backoff
- Defined in:
- lib/rhod/backoffs/backoff.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(state = nil) ⇒ Backoff
constructor
A new instance of Backoff.
- #iterate ⇒ Object
- #next ⇒ Object
Constructor Details
#initialize(state = nil) ⇒ Backoff
Returns a new instance of Backoff.
4 5 6 |
# File 'lib/rhod/backoffs/backoff.rb', line 4 def initialize(state = nil) @state = state end |
Instance Attribute Details
#state ⇒ Object (readonly)
Returns the value of attribute state.
2 3 4 |
# File 'lib/rhod/backoffs/backoff.rb', line 2 def state @state end |
Instance Method Details
#iterate ⇒ Object
8 9 10 |
# File 'lib/rhod/backoffs/backoff.rb', line 8 def iterate raise NotImplementedError end |
#next ⇒ Object
12 13 14 15 |
# File 'lib/rhod/backoffs/backoff.rb', line 12 def next @state, result = iterate(state) result end |