Class: Kodama::Client::RetryInfo
- Inherits:
-
Object
- Object
- Kodama::Client::RetryInfo
- Defined in:
- lib/kodama/client.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#wait ⇒ Object
Returns the value of attribute wait.
Instance Method Summary collapse
- #count_reset ⇒ Object
- #count_up ⇒ Object
-
#initialize(options = {}) ⇒ RetryInfo
constructor
A new instance of RetryInfo.
- #retryable? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ RetryInfo
Returns a new instance of RetryInfo.
205 206 207 208 209 |
# File 'lib/kodama/client.rb', line 205 def initialize( = {}) @wait = [:wait] || 3 @limit = [:limit] || 100 @count = 0 end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
204 205 206 |
# File 'lib/kodama/client.rb', line 204 def count @count end |
#limit ⇒ Object
Returns the value of attribute limit.
204 205 206 |
# File 'lib/kodama/client.rb', line 204 def limit @limit end |
#wait ⇒ Object
Returns the value of attribute wait.
204 205 206 |
# File 'lib/kodama/client.rb', line 204 def wait @wait end |
Instance Method Details
#count_reset ⇒ Object
219 220 221 |
# File 'lib/kodama/client.rb', line 219 def count_reset @count = 0 end |
#count_up ⇒ Object
215 216 217 |
# File 'lib/kodama/client.rb', line 215 def count_up @count += 1 end |
#retryable? ⇒ Boolean
211 212 213 |
# File 'lib/kodama/client.rb', line 211 def retryable? @count < @limit end |