Class: RunLoop::RetryOpts
- Inherits:
-
Object
- Object
- RunLoop::RetryOpts
- Defined in:
- lib/run_loop/patches/retriable.rb
Overview
A class to bridge the gap between retriable 1.x and 2.0.
Class Method Summary collapse
Class Method Details
.tries_and_interval(tries, interval, other_retry_options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/run_loop/patches/retriable.rb', line 6 def self.tries_and_interval(tries, interval, ={}) retriable_version = RunLoop::Version.new(Retriable::VERSION) if [:tries] raise RuntimeError, ':tries is not a valid key for other_retry_options' elsif [:interval] raise RuntimeError, ':interval is not a valid key for other_retry_options' elsif [:intervals] raise RuntimeError, ':intervals is not a valid key for other_retry_options' end if retriable_version >= RunLoop::Version.new('2.0.0') .merge({:intervals => Array.new(tries, interval)}) else .merge({:tries => tries, :interval => interval}) end end |