class Sidekiq::TrackableBatch::Stage

@api private

Attributes

job_list[R]

Public Class Methods

new(description, target, **kwargs, &block) click to toggle source
Calls superclass method Sidekiq::TrackableBatch::new
# File lib/sidekiq/trackable_batch/stage.rb, line 8
def initialize(description, target, **kwargs, &block)
  self.description = description
  if target.respond_to?(:include?) && target.include?('#')
    @target = target
  end
  @kwargs = kwargs
  @block = block
  @job_list = []
  super(&nil)
end

Public Instance Methods

setup(enclosing_batch) click to toggle source
# File lib/sidekiq/trackable_batch/stage.rb, line 19
def setup(enclosing_batch)
  if @target
    klass, method = @target.split('#')
    Object.const_get(klass).new.send(method, self, **@kwargs)
  end
  instance_exec(**@kwargs, &@block) if @block
  job_list.each { |job| enclosing_batch.register_job(job) }
end