Method: ClassX::Pluggable::Util.nested_autoload

Defined in:
lib/classx/pluggable.rb

.nested_autoload(mod, path) ⇒ Object



162
163
164
165
166
167
168
169
170
# File 'lib/classx/pluggable.rb', line 162

def nested_autoload mod, path
  name_spaces = mod.split(/::/)
  target = name_spaces.pop
  tmp = ::Object
  name_spaces.each do |const|
    tmp = tmp.const_get(const)
  end
  tmp.autoload(target, path)
end