Class: FuzzBert::Executor::DataProducer::Ring

Inherits:
Object
  • Object
show all
Defined in:
lib/fuzzbert/executor.rb

Instance Method Summary collapse

Constructor Details

#initialize(objs) ⇒ Ring

Returns a new instance of Ring.

Raises:

  • (ArgumentError)


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

#nextObject



160
161
162
163
164
# File 'lib/fuzzbert/executor.rb', line 160

def next
  obj = @objs[@i]
  @i = (@i + 1) % @objs.size
  obj
end