Class: Orchestrated::LastCompletion

Inherits:
CompositeCompletion show all
Defined in:
lib/orchestrated/completion.rb

Instance Method Summary collapse

Methods inherited from CompositeCompletion

#+

Methods inherited from CompletionExpression

#notify_dependents_of_cancellation, #notify_dependents_of_completion

Instance Method Details

#<<(c) ⇒ Object


51
52
53
54
# File 'lib/orchestrated/completion.rb', line 51

def <<(c)
  prerequisites << c unless c.always_complete?
  self
end

#always_complete?Boolean

Returns:

  • (Boolean)

48
# File 'lib/orchestrated/completion.rb', line 48

def always_complete?; prerequisite_associations.empty?; end

#canceled?Boolean

Returns:

  • (Boolean)

50
# File 'lib/orchestrated/completion.rb', line 50

def canceled?; prerequisite_associations.any?(&:canceled?); end

#complete?Boolean

Returns:

  • (Boolean)

47
# File 'lib/orchestrated/completion.rb', line 47

def complete?; prerequisite_associations.all?(&:complete?); end

#never_complete?Boolean

Returns:

  • (Boolean)

49
# File 'lib/orchestrated/completion.rb', line 49

def never_complete?; prerequisites.any?(&:never_complete?); end

#prerequisite_canceledObject


58
59
60
# File 'lib/orchestrated/completion.rb', line 58

def prerequisite_canceled
  notify_dependents_of_cancellation
end

#prerequisite_completeObject


55
56
57
# File 'lib/orchestrated/completion.rb', line 55

def prerequisite_complete
  notify_dependents_of_completion unless prerequisite_associations.without_states('complete').exists?
end