Module: MultiDir

Defined in:
lib/multi_dir.rb,
lib/multi_dir/paths.rb,
lib/multi_dir/version.rb,
lib/multi_dir/pathname_patch.rb

Defined Under Namespace

Modules: PathnamePatch, VERSION Classes: Paths

Class Method Summary collapse

Class Method Details

.[](symbol) ⇒ Object Also known as: resolve



17
18
19
# File 'lib/multi_dir.rb', line 17

def [](symbol)
  Pathname.new MultiDir::Paths.instance.resolve symbol
end

.define_path_method(name) ⇒ Object



10
11
12
13
14
15
# File 'lib/multi_dir.rb', line 10

def define_path_method(name)
  name = name.to_sym
  singleton_class.instance_eval do
    define_method(name) { self.resolve name }
  end
end