Sha256: 5a0636b316f7a592928d001d1e191ba65895e0c0bfaa850d72d2026577d266b8
Contents?: true
Size: 606 Bytes
Versions: 34
Compression:
Stored size: 606 Bytes
Contents
# frozen_string_literal: true module Reek module AST # # Locates references to the current object within a portion # of an abstract syntax tree. # class ReferenceCollector def initialize(ast) @ast = ast end def num_refs_to_self (explicit_self_calls.to_a + implicit_self_calls.to_a).size end private attr_reader :ast def explicit_self_calls ast.each_node([:self, :super, :zsuper, :ivar, :ivasgn]) end def implicit_self_calls ast.each_node(:send).reject(&:receiver) end end end end
Version data entries
34 entries across 32 versions & 2 rubygems