Class: DeepCover::Node::TrivialBranch

Inherits:
EmptyBody show all
Defined in:
lib/deep_cover/node/branch.rb

Constant Summary

Constants inherited from DeepCover::Node

CLASSES, Complex, Cvasgn, Dsym, Erange, Float, Int, Ivar, Kwarg, Kwoptarg, Kwrestarg, OrAsgn, Rational, Sym, True, Zsuper

Instance Attribute Summary

Attributes inherited from DeepCover::Node

#base_node, #children, #index, #next_sibling, #parent, #previous_sibling

Instance Method Summary collapse

Methods inherited from EmptyBody

#is_statement, #loc_hash, #rewriting_rules

Methods inherited from DeepCover::Node

#[], [], atom, #children_nodes, #covered_code, define_module_class, #each_node, #fancy_type, #find_all, has_evaluated_segments, inherited, #simple_literal?, #to_s, #type

Methods included from Memoize

#freeze, included

Constructor Details

#initialize(other_branch:, condition:, position: true) ⇒ TrivialBranch

Returns a new instance of TrivialBranch.



21
22
23
24
25
# File 'lib/deep_cover/node/branch.rb', line 21

def initialize(other_branch:, condition:, position: true)
  @condition = condition
  @other_branch = other_branch
  super(nil, parent: condition.parent, position: position)
end

Instance Method Details

#flow_entry_countObject



27
28
29
# File 'lib/deep_cover/node/branch.rb', line 27

def flow_entry_count
  @condition.flow_completion_count - @other_branch.flow_entry_count
end