Class: DeepCover::Node::Block

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

#children_nodes_in_flow_orderObject



45
46
47
# File 'lib/deep_cover/node/block.rb', line 45

def children_nodes_in_flow_order
  [call] # Similarly to a def, the body (and Args) are actually not part of the flow of this node...
end

#execution_countObject



41
42
43
# File 'lib/deep_cover/node/block.rb', line 41

def execution_count
  call.execution_count
end

#rewriteObject



50
51
52
53
54
55
56
# File 'lib/deep_cover/node/block.rb', line 50

def rewrite
  if call.is_a?(Csend)
    rewrite_for_completion.gsub('%{node}', Csend::REWRITE_SUFFIX_IN_BLOCK)
  else
    rewrite_for_completion
  end
end

#rewrite_for_completionObject



49
# File 'lib/deep_cover/node/block.rb', line 49

alias_method :rewrite_for_completion, :rewrite