Class: Rhod::Backoffs::Random

Inherits:
Backoff
  • Object
show all
Defined in:
lib/rhod/backoffs/random.rb

Instance Attribute Summary

Attributes inherited from Backoff

#state

Instance Method Summary collapse

Methods inherited from Backoff

#initialize, #next

Constructor Details

This class inherits a constructor from Rhod::Backoffs::Backoff

Instance Method Details

#iterate(state) ⇒ Object



2
3
4
5
# File 'lib/rhod/backoffs/random.rb', line 2

def iterate(state)
  @float_range ||= (state.min.to_f..state.max.to_f)
  [@float_range, rand(@float_range)]
end