Class: Rector::Job::WorkerCollection

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/rector/job.rb

Instance Method Summary collapse

Constructor Details

#initialize(job) ⇒ WorkerCollection

Returns a new instance of WorkerCollection.



7
8
9
10
11
12
# File 'lib/rector/job.rb', line 7

def initialize(job)
  @job = job

  # Wraps an array
  super(Array.new)
end

Instance Method Details

#createObject



14
15
16
17
18
# File 'lib/rector/job.rb', line 14

def create
  Rector::Worker.new(@job.allocate_worker_id).tap do |worker|
    self << worker
  end
end