Module: RailsWorkflow::OperationTemplates::DefaultBuilder::ClassMethods

Defined in:
app/concerns/rails_workflow/operation_templates/default_builder.rb

Instance Method Summary collapse

Instance Method Details

#build_context(dependencies) ⇒ Object



50
51
52
# File 'app/concerns/rails_workflow/operation_templates/default_builder.rb', line 50

def build_context dependencies
  dependencies.first.try(:context).try(:data)
end

#build_context!(operation, dependencies) ⇒ Object



54
55
56
57
58
# File 'app/concerns/rails_workflow/operation_templates/default_builder.rb', line 54

def build_context! operation, dependencies
  RailsWorkflow::Context.new(
      parent: operation,
      data: build_context(dependencies) || operation.process.data)
end