Module: CMDx::Workflow

Defined in:
lib/cmdx/workflow.rb

Overview

Mixin that turns a Task subclass into a workflow: a pipeline of ordered task groups run sequentially or in parallel. Defining ‘#work` on a workflow is forbidden — `#work` is auto-generated to delegate to Pipeline. Subclasses inherit the parent’s pipeline (via dup).

See Also:

Defined Under Namespace

Modules: ClassMethods Classes: ExecutionGroup

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ void

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.

This method returns an undefined value.

Parameters:

  • base (Class)

    task class including this mixin



98
99
100
# File 'lib/cmdx/workflow.rb', line 98

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#workvoid

This method returns an undefined value.

Runs the workflow’s pipeline. Not meant to be overridden.



105
106
107
# File 'lib/cmdx/workflow.rb', line 105

def work
  Pipeline.execute(self)
end