Class: ZombieScout::MethodCallFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/zombie_scout/method_call_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(ruby_project) ⇒ MethodCallFinder

Returns a new instance of MethodCallFinder.



4
5
6
# File 'lib/zombie_scout/method_call_finder.rb', line 4

def initialize(ruby_project)
  @ruby_project = ruby_project
end

Instance Method Details

#count_calls(method_name) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/zombie_scout/method_call_finder.rb', line 8

def count_calls(method_name)
  method_name = method_name.to_s

  # zero-or-more spaces, =, and NOT a > (so we don't match hashrockets)
  method_name.sub!(/=$/, ' *=[^>]')

  find_occurrances(method_name).size
end