Class: Reek::AST::ReferenceCollector Private

Inherits:
Object
  • Object
show all
Defined in:
lib/reek/ast/reference_collector.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Locates references to the current object within a portion of an abstract syntax tree.

Constant Summary collapse

STOP_NODES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

[:class, :module, :def, :defs]

Instance Method Summary collapse

Constructor Details

#initialize(ast) ⇒ ReferenceCollector

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ReferenceCollector.



11
12
13
# File 'lib/reek/ast/reference_collector.rb', line 11

def initialize(ast)
  @ast = ast
end

Instance Method Details

#num_refs_to_selfObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
# File 'lib/reek/ast/reference_collector.rb', line 15

def num_refs_to_self
  (explicit_self_calls + implicit_self_calls).size
end