class Dynflow::ExecutionPlan::DependencyGraph
Public Class Methods
new()
click to toggle source
# File lib/dynflow/execution_plan/dependency_graph.rb, line 4 def initialize @graph = Hash.new { |h, k| h[k] = Set.new } end
Public Instance Methods
add_dependencies(step, action)
click to toggle source
adds dependencies to graph that step
has based on the steps
referenced in its input
# File lib/dynflow/execution_plan/dependency_graph.rb, line 10 def add_dependencies(step, action) action.required_step_ids.each do |required_step_id| @graph[step.id] << required_step_id end end
mark_satisfied(step_id, required_step_id)
click to toggle source
# File lib/dynflow/execution_plan/dependency_graph.rb, line 20 def mark_satisfied(step_id, required_step_id) @graph[step_id].delete(required_step_id) end
required_step_ids(step_id)
click to toggle source
# File lib/dynflow/execution_plan/dependency_graph.rb, line 16 def required_step_ids(step_id) @graph[step_id] end
unresolved?()
click to toggle source
# File lib/dynflow/execution_plan/dependency_graph.rb, line 24 def unresolved? @graph.any? { |step_id, required_step_ids| required_step_ids.any? } end