Class: Wolflow::Recursion
- Defined in:
- lib/wolflow/recursion.rb
Instance Attribute Summary
Attributes inherited from Simple
Attributes inherited from TaskSpec
#connects_to, #id, #name, #prev_tasks, #workflow_spec
Instance Method Summary collapse
Methods inherited from Simple
#choose, #connect, #connects_with, from_hash, #initialize, #inspect, #precedes?, #to_hash, #to_hash_tree, #workflow_spec=
Methods inherited from TaskSpec
#child_of?, #each_ancestor, #each_child, #each_parent, #each_successor, from_hash, inherited, #initialize
Constructor Details
This class inherits a constructor from Wolflow::Simple
Instance Method Details
#build_next_tasks(task) ⇒ Object
17 18 19 |
# File 'lib/wolflow/recursion.rb', line 17 def build_next_tasks(task, **) super if task.completed? end |
#on_complete(task) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/wolflow/recursion.rb', line 5 def on_complete(task) return if task.completed? return unless task.children.empty? super end |
#predict(task, next_tasks) ⇒ Object
13 14 15 |
# File 'lib/wolflow/recursion.rb', line 13 def predict(task, next_tasks) build_next_tasks(task, next_tasks: next_tasks) end |