Class: Postjob::Registry::WorkflowSpec
- Inherits:
-
Object
- Object
- Postjob::Registry::WorkflowSpec
- Defined in:
- lib/postjob/registry.rb
Defined Under Namespace
Classes: Options
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#workflow ⇒ Object
readonly
Returns the value of attribute workflow.
Instance Method Summary collapse
-
#initialize(workflow, options) ⇒ WorkflowSpec
constructor
A new instance of WorkflowSpec.
- #name ⇒ Object
- #runnable? ⇒ Boolean
- #supports_cleanup? ⇒ Boolean
Constructor Details
#initialize(workflow, options) ⇒ WorkflowSpec
Returns a new instance of WorkflowSpec.
129 130 131 132 133 |
# File 'lib/postjob/registry.rb', line 129 def initialize(workflow, ) expect! workflow => [ Module, String ] @workflow = workflow = Options.new() end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
116 117 118 |
# File 'lib/postjob/registry.rb', line 116 def end |
#workflow ⇒ Object (readonly)
Returns the value of attribute workflow.
115 116 117 |
# File 'lib/postjob/registry.rb', line 115 def workflow @workflow end |
Instance Method Details
#name ⇒ Object
122 123 124 125 126 127 |
# File 'lib/postjob/registry.rb', line 122 def name case workflow when Module then workflow.name when String then workflow end end |
#runnable? ⇒ Boolean
118 119 120 |
# File 'lib/postjob/registry.rb', line 118 def runnable? workflow.is_a?(Module) end |
#supports_cleanup? ⇒ Boolean
135 136 137 138 139 140 |
# File 'lib/postjob/registry.rb', line 135 def supports_cleanup? return false unless lookup_workflow_method(:run) return false unless lookup_workflow_method(:cleanup) true end |