class Mutest::Parallel::Source::Array
Job
source backed by a finite array
Public Class Methods
new(*)
click to toggle source
Initialize objecto
@return [undefined]
Calls superclass method
# File lib/mutest/parallel/source.rb, line 29 def initialize(*) super @next_index = 0 end
Public Instance Methods
next()
click to toggle source
Next job
@return [Object]
@raise [NoJobError]
when no next job is available
# File lib/mutest/parallel/source.rb, line 48 def next raise NoJobError unless next? jobs.fetch(@next_index).tap do @next_index += 1 end end
next?()
click to toggle source
Test
if next job is available
@return [Boolean]
# File lib/mutest/parallel/source.rb, line 38 def next? @next_index < jobs.length end