Class: DeepCover::Node::Begin

Inherits:
DeepCover::Node show all
Defined in:
lib/deep_cover/node/begin.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 DeepCover::Node

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

Methods included from Memoize

#freeze, included

Constructor Details

This class inherits a constructor from DeepCover::Node

Instance Method Details

#executed_loc_keysObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/deep_cover/node/begin.rb', line 13

def executed_loc_keys
  # Begin is a generic grouping used in different contexts.
  case loc_hash[:begin] && loc_hash[:begin].source
  when nil, '(', 'begin'
    []
  when 'else', '#{'
    %i[begin end]
  else
    raise "Unknown context for Begin node: #{loc_hash[:begin].source}"
  end
end

#is_statementObject



9
10
11
# File 'lib/deep_cover/node/begin.rb', line 9

def is_statement
  false
end