Class: Conflow::Flow::JobBuilder Private
- Inherits:
-
Object
- Object
- Conflow::Flow::JobBuilder
- Defined in:
- lib/conflow/flow/job_builder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Handles creating jobs
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
private
Holds mapping between worker classes and Job objects.
Instance Method Summary collapse
-
#call(worker_class, params, dependencies) ⇒ Conflow::Job+
private
Create new job and resolve it’s dependencies.
-
#initialize ⇒ JobBuilder
constructor
private
Initialize JobBuilder with new empty context.
Constructor Details
#initialize ⇒ JobBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize Conflow::Flow::JobBuilder with new empty context
12 13 14 |
# File 'lib/conflow/flow/job_builder.rb', line 12 def initialize @context = {} end |
Instance Attribute Details
#context ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Holds mapping between worker classes and Job objects
9 10 11 |
# File 'lib/conflow/flow/job_builder.rb', line 9 def context @context end |
Instance Method Details
#call(worker_class, params, dependencies) ⇒ Conflow::Job+
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create new job and resolve it’s dependencies.
19 20 21 22 23 24 25 26 27 |
# File 'lib/conflow/flow/job_builder.rb', line 19 def call(worker_class, params, dependencies) job = initialize_job(worker_class) promises, params = extract_promises(job, params) dependencies = build_dependencies(promises, dependencies) assign_job_attributes(job, promises, params) [job, dependencies] end |