Class: DurableFlow::ChildWorkflowBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/durable_flow/child_workflow_builder.rb

Defined Under Namespace

Classes: Request

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeChildWorkflowBuilder

Returns a new instance of ChildWorkflowBuilder.



13
14
15
# File 'lib/durable_flow/child_workflow_builder.rb', line 13

def initialize
  @requests = []
end

Instance Attribute Details

#requestsObject (readonly)

Returns the value of attribute requests.



11
12
13
# File 'lib/durable_flow/child_workflow_builder.rb', line 11

def requests
  @requests
end

Instance Method Details

#workflow(workflow_class, *args, key:, **kwargs) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/durable_flow/child_workflow_builder.rb', line 17

def workflow(workflow_class, *args, key:, **kwargs)
  requests << Request.new(
    workflow_key: key.to_s,
    workflow_class: workflow_class,
    workflow_args: args,
    workflow_kwargs: kwargs
  )
end