Sha256: cee07ea667f6faf28ebdfdd6545972d1cf404f5b62bc0b3329638bdc49bdce47
Contents?: true
Size: 699 Bytes
Versions: 11
Compression:
Stored size: 699 Bytes
Contents
require_relative 'empty_body' module DeepCover class Node module Branch def flow_completion_count branches.map(&:flow_completion_count).inject(0, :+) end # Define in sublasses: def branches raise NotImplementedError end # Also define flow_entry_count end class TrivialBranch < Node::EmptyBody def initialize(condition, other_branch, position: true) @condition = condition @other_branch = other_branch super(nil, parent: condition.parent, position: position) end def flow_entry_count @condition.flow_completion_count - @other_branch.flow_entry_count end end end end
Version data entries
11 entries across 11 versions & 1 rubygems