Class: Modloc::Locator

Inherits:
Object
  • Object
show all
Defined in:
lib/modloc/locator.rb

Overview

Locator for a given module or class

Instance Method Summary collapse

Constructor Details

#initialize(mod) ⇒ Locator

Create a new locator for a module or class

Parameters:



6
7
8
# File 'lib/modloc/locator.rb', line 6

def initialize(mod)
  @mod = mod
end

Instance Method Details

#findArray

Finds all the locations of a given module or class

Returns:

  • (Array)


12
13
14
15
16
# File 'lib/modloc/locator.rb', line 12

def find
  valid_sources.reduce([]) do |locations, source|
    locations + source.locate_all(source_regex)
  end
end