Class: WorkflowTemplate::Definer::HasActions::Inside
- Inherits:
-
Object
- Object
- WorkflowTemplate::Definer::HasActions::Inside
- Defined in:
- lib/workflow_template/definer/has_actions/inside.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
Instance Method Summary collapse
- #apply_onto(actions, action) ⇒ Object
-
#initialize(reference, block) ⇒ Inside
constructor
A new instance of Inside.
Constructor Details
#initialize(reference, block) ⇒ Inside
Returns a new instance of Inside.
11 12 13 14 15 |
# File 'lib/workflow_template/definer/has_actions/inside.rb', line 11 def initialize(reference, block) @reference = reference @block = block freeze end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
9 10 11 |
# File 'lib/workflow_template/definer/has_actions/inside.rb', line 9 def block @block end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
9 10 11 |
# File 'lib/workflow_template/definer/has_actions/inside.rb', line 9 def reference @reference end |
Instance Method Details
#apply_onto(actions, action) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/workflow_template/definer/has_actions/inside.rb', line 17 def apply_onto(actions, action) raise Error, 'Action expected to be nil' unless action.nil? before, action, after = Position.slice_actions(actions, reference) clone = action.duplicate(&block) [*before, clone, *after] end |