Sha256: 49a0630f4ed6a04fe661b5e60fad8884d98970628f25365b2b6fbffc3def4c03
Contents?: true
Size: 731 Bytes
Versions: 30
Compression:
Stored size: 731 Bytes
Contents
# frozen_string_literal: true 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(other_branch:, condition:, 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
30 entries across 30 versions & 2 rubygems