Class: FuzzBert::Executor::DataProducer::Ring
- Inherits:
-
Object
- Object
- FuzzBert::Executor::DataProducer::Ring
- Defined in:
- lib/fuzzbert/executor.rb
Instance Method Summary collapse
-
#initialize(objs) ⇒ Ring
constructor
A new instance of Ring.
- #next ⇒ Object
Constructor Details
#initialize(objs) ⇒ Ring
Returns a new instance of Ring.
153 154 155 156 157 158 |
# File 'lib/fuzzbert/executor.rb', line 153 def initialize(objs) @i = 0 objs = [objs] unless objs.respond_to?(:each) @objs = objs.to_a raise ArgumentError.new("No test cases found") if @objs.empty? end |
Instance Method Details
#next ⇒ Object
160 161 162 163 164 |
# File 'lib/fuzzbert/executor.rb', line 160 def next obj = @objs[@i] @i = (@i + 1) % @objs.size obj end |