Class: Ripe::DSL::WorkflowDSL
- Inherits:
-
Object
- Object
- Ripe::DSL::WorkflowDSL
- Defined in:
- lib/ripe/dsl/workflow_dsl.rb
Overview
This class provides a DSL for defining a workflow. It should only be called by #workflow.
Instance Attribute Summary collapse
-
#callback ⇒ Proc
readonly
the block describing what to do apply to each sample.
-
#handle ⇒ String
readonly
the name of the workflow.
-
#params ⇒ Hash<Symbol, String>
readonly
list of parameters.
Instance Method Summary collapse
-
#describe(&block) ⇒ Object
Describe the workflow in terms of a task.
-
#initialize(handle, &block) ⇒ WorkflowDSL
constructor
Create a new
Workflow
DSL. -
#param(key, value) ⇒ Object
Register a parameter.
Constructor Details
#initialize(handle, &block) ⇒ WorkflowDSL
Create a new Workflow
DSL
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/ripe/dsl/workflow_dsl.rb', line 56 def initialize(handle, &block) @handle = handle @params = { handle: handle } @callback = nil if block_given? if block.arity == 1 yield self else instance_eval &block end end end |
Instance Attribute Details
#callback ⇒ Proc (readonly)
the block describing what to do apply to each sample
46 47 48 |
# File 'lib/ripe/dsl/workflow_dsl.rb', line 46 def callback @callback end |
#handle ⇒ String (readonly)
the name of the workflow
46 47 48 |
# File 'lib/ripe/dsl/workflow_dsl.rb', line 46 def handle @handle end |
#params ⇒ Hash<Symbol, String> (readonly)
list of parameters
46 47 48 |
# File 'lib/ripe/dsl/workflow_dsl.rb', line 46 def params @params end |
Instance Method Details
#describe(&block) ⇒ Object
Describe the workflow in terms of a task.
89 90 91 |
# File 'lib/ripe/dsl/workflow_dsl.rb', line 89 def describe(&block) @callback = block end |
#param(key, value) ⇒ Object
Register a parameter
76 77 78 |
# File 'lib/ripe/dsl/workflow_dsl.rb', line 76 def param(key, value) @params.merge!({ key => value }) end |