Class: Zenaton::Interfaces::Workflow Abstract

Inherits:
Job
  • Object
show all
Defined in:
lib/zenaton/interfaces/workflow.rb

Overview

This class is abstract.

Subclass and override #handle to implement a custom Workflow

Direct Known Subclasses

Workflows::Version

Instance Method Summary collapse

Instance Method Details

#contextZenaton::Contexts::Workflow

Returns the workflow execution context.

Returns:



24
25
26
# File 'lib/zenaton/interfaces/workflow.rb', line 24

def context
  @context || Contexts::Workflow.new
end

#handleObject

Method called to run the workflow

Raises:



11
12
13
14
# File 'lib/zenaton/interfaces/workflow.rb', line 11

def handle
  raise NotImplemented,
        "Your workflow does not implement the `handle' method"
end

#idString, ...

(Optional) Implement this method if you want to use custom IDs for your workflows.

Returns:

  • (String, Integer, NilClass)

    the custom id. Must be <= 256 bytes.



19
20
21
# File 'lib/zenaton/interfaces/workflow.rb', line 19

def id
  nil
end