Class: Wye::Distributor::RoundRobin
- Inherits:
-
Object
- Object
- Wye::Distributor::RoundRobin
- Defined in:
- lib/wye/distributor/round_robin.rb
Instance Method Summary collapse
-
#initialize(values) ⇒ RoundRobin
constructor
A new instance of RoundRobin.
- #next(*arguments) ⇒ Object
Constructor Details
#initialize(values) ⇒ RoundRobin
Returns a new instance of RoundRobin.
4 5 6 |
# File 'lib/wye/distributor/round_robin.rb', line 4 def initialize(values) @cycle = values.cycle end |
Instance Method Details
#next(*arguments) ⇒ Object
8 9 10 11 12 |
# File 'lib/wye/distributor/round_robin.rb', line 8 def next(*arguments) @cycle.next rescue StopIteration nil end |