Class: Wolflow::SimpleMerge

Inherits:
Simple show all
Defined in:
lib/wolflow/simple_merge.rb

Instance Attribute Summary

Attributes inherited from Simple

#next_tasks

Attributes inherited from TaskSpec

#connects_to, #id, #name, #prev_tasks, #workflow_spec

Instance Method Summary collapse

Methods inherited from Simple

#build_next_tasks, #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

#join(*task_specs) ⇒ Object



5
6
7
8
9
# File 'lib/wolflow/simple_merge.rb', line 5

def join(*task_specs)
  task_specs.each { |spec| spec.connect(self) }

  self
end

#on_complete(task) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/wolflow/simple_merge.rb', line 11

def on_complete(task)
  return unless task.parents.one?(&:completed?)

  task.parents.each { |parent| parent.disconnect(task) unless parent.completed? }

  super
end