Class: DeepCover::Node::CsendInnerSend

Inherits:
SendBase show all
Includes:
ExecutedAfterChildren
Defined in:
lib/deep_cover/node/send.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 SendBase

#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, #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

#flow_completion_countObject



83
84
85
86
# File 'lib/deep_cover/node/send.rb', line 83

def flow_completion_count
  return parent.parent.flow_completion_count if has_block?
  completion_tracker_hits
end

#has_block?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/deep_cover/node/send.rb', line 74

def has_block?
  parent.has_block?
end

#loc_hashObject



88
89
90
91
92
93
# File 'lib/deep_cover/node/send.rb', line 88

def loc_hash
  # This is only a partial Send, the receiver param and the dot are actually handled by the parent Csend.
  h = super.dup
  h[:expression] = h[:expression].with(begin_pos: h[:selector_begin].begin_pos)
  h
end

#rewriteObject



78
79
80
81
# File 'lib/deep_cover/node/send.rb', line 78

def rewrite
  # All the rest of the rewriting logic is in Csend
  '%{node});%{completion_tracker};' unless has_block?
end