Module: DeepCover::Node::BackwardsStrategy

Instance Method Summary collapse

Instance Method Details

#flow_completion_countObject

Instead of assuming our parent tracks our entry and we are responsible for tracking our completion, we go the other way and assume our parent tracks our completion and we are responsible for our entry.



40
41
42
43
44
45
46
# File 'lib/deep_cover/node/assignments.rb', line 40

def flow_completion_count
  if (s = next_sibling)
    s.flow_entry_count
  else
    parent.flow_completion_count
  end
end

#flow_entry_countObject



48
49
50
51
52
53
54
# File 'lib/deep_cover/node/assignments.rb', line 48

def flow_entry_count
  if (first_child = children_nodes.first)
    first_child.flow_entry_count
  else
    flow_completion_count
  end
end