Class: Take2::Backoff
- Inherits:
-
Object
- Object
- Take2::Backoff
- Defined in:
- lib/take2/backoff.rb
Instance Attribute Summary collapse
-
#factor ⇒ Object
readonly
Returns the value of attribute factor.
-
#intervals ⇒ Object
readonly
Returns the value of attribute intervals.
-
#retries ⇒ Object
readonly
Returns the value of attribute retries.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, start = 1, factor = 1, retries = 10) ⇒ Backoff
constructor
A new instance of Backoff.
Constructor Details
#initialize(type, start = 1, factor = 1, retries = 10) ⇒ Backoff
Returns a new instance of Backoff.
7 8 9 10 11 12 13 |
# File 'lib/take2/backoff.rb', line 7 def initialize(type, start = 1, factor = 1, retries = 10) @type = type @start = start.to_i @retries = retries @factor = factor @intervals = intervals_table end |
Instance Attribute Details
#factor ⇒ Object (readonly)
Returns the value of attribute factor.
5 6 7 |
# File 'lib/take2/backoff.rb', line 5 def factor @factor end |
#intervals ⇒ Object (readonly)
Returns the value of attribute intervals.
5 6 7 |
# File 'lib/take2/backoff.rb', line 5 def intervals @intervals end |
#retries ⇒ Object (readonly)
Returns the value of attribute retries.
5 6 7 |
# File 'lib/take2/backoff.rb', line 5 def retries @retries end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
5 6 7 |
# File 'lib/take2/backoff.rb', line 5 def start @start end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/take2/backoff.rb', line 5 def type @type end |