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.



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

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

#flow_entry_countObject



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

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