Method: Wright::Util::RecursiveAutoloader.add_autoloads
- Defined in:
- lib/wright/util/recursive_autoloader.rb
.add_autoloads(directory, parent_class) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Adds autoloads for all files in a directory to a parent class.
Registers all files in directory to be autoloaded the first time ParentClass::CamelCased::FileName is accessed.
45 46 47 48 49 50 |
# File 'lib/wright/util/recursive_autoloader.rb', line 45 def self.add_autoloads(directory, parent_class) unless class_exists?(parent_class) fail ArgumentError, "Can't resolve parent_class #{parent_class}" end add_autoloads_unsafe(directory, parent_class) end |