Class: Rector::Job::WorkerCollection
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Rector::Job::WorkerCollection
- Defined in:
- lib/rector/job.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(job) ⇒ WorkerCollection
constructor
A new instance of WorkerCollection.
Constructor Details
#initialize(job) ⇒ 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
#create ⇒ Object
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 |