Locates references to the current object within a portion of an abstract syntax tree.
# File lib/reek/source/reference_collector.rb, line 16 def num_refs_to_self result = 0 [:self, :zsuper, :ivar, :iasgn].each do |node_type| @ast.look_for(node_type, STOP_NODES) { result += 1} end @ast.look_for(:call, STOP_NODES) do |call| result += 1 unless call.receiver end result end
Generated with the Darkfish Rdoc Generator 2.