Class: Modloc::Locator
- Inherits:
-
Object
- Object
- Modloc::Locator
- Defined in:
- lib/modloc/locator.rb
Overview
Locator for a given module or class
Instance Method Summary collapse
-
#find ⇒ Array
Finds all the locations of a given module or class.
-
#initialize(mod) ⇒ Locator
constructor
Create a new locator for a module or class.
Constructor Details
#initialize(mod) ⇒ Locator
Create a new locator for a module or class
6 7 8 |
# File 'lib/modloc/locator.rb', line 6 def initialize(mod) @mod = mod end |
Instance Method Details
#find ⇒ Array
Finds all the locations of a given module or class
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 |