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



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

def children_nodes_in_flow_order
  [call, args] # Similarly to a def, the body is actually not part of the flow of this node...
end

#rewriteObject



46
47
48
49
50
51
52
# File 'lib/deep_cover/node/block.rb', line 46

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

#rewrite_for_completionObject



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

alias_method :rewrite_for_completion, :rewrite