Class: WorkflowTemplate::Definer::HasActions::Insert
- Inherits:
-
Object
- Object
- WorkflowTemplate::Definer::HasActions::Insert
- Defined in:
- lib/workflow_template/definer/has_actions/insert.rb
Instance Method Summary collapse
- #apply(action_name, **opts, &block) ⇒ Object
-
#initialize(workflow, position, reference) ⇒ Insert
constructor
A new instance of Insert.
Constructor Details
#initialize(workflow, position, reference) ⇒ Insert
Returns a new instance of Insert.
7 8 9 10 11 |
# File 'lib/workflow_template/definer/has_actions/insert.rb', line 7 def initialize(workflow, position, reference) @workflow = workflow @position = position @reference = reference end |
Instance Method Details
#apply(action_name, **opts, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/workflow_template/definer/has_actions/insert.rb', line 13 def apply(action_name, **opts, &block) @workflow.send( :insert_action, action_name, position: @position, reference: @reference, **opts, &block ) @workflow = nil nil end |