Class: DeepCover::Node::If
- Inherits:
-
DeepCover::Node
- Object
- DeepCover::Node
- DeepCover::Node::If
- Includes:
- Branch
- Defined in:
- lib/deep_cover/node/if.rb
Constant Summary
Constants inherited from DeepCover::Node
And, 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
- #branches ⇒ Object
- #execution_count ⇒ Object
-
#style ⇒ Object
returns on of %i[ternary if unless elsif].
Methods included from Branch
Methods inherited from DeepCover::Node
[], #[], atom, #children_nodes, #covered_code, #each_node, #fancy_type, #find_all, has_evaluated_segments, inherited, #initialize, #to_s, #type
Methods included from Memoize
Constructor Details
This class inherits a constructor from DeepCover::Node
Instance Method Details
#branches ⇒ Object
23 24 25 |
# File 'lib/deep_cover/node/if.rb', line 23 def branches [true_branch, false_branch] end |
#execution_count ⇒ Object
27 28 29 |
# File 'lib/deep_cover/node/if.rb', line 27 def execution_count condition.flow_completion_count end |
#style ⇒ Object
returns on of %i[ternary if unless elsif]
32 33 34 35 |
# File 'lib/deep_cover/node/if.rb', line 32 def style keyword = loc_hash[:keyword] keyword ? keyword.source.to_sym : :ternary end |