Module: Wright::Util::RecursiveAutoloader Private
- Defined in:
- lib/wright/util/recursive_autoloader.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Recursive autoloader, recursively adds autoloads for all files in a directory.
Class Method Summary collapse
-
.add_autoloads(directory, parent_class) ⇒ void
private
Adds autoloads for all files in a directory to a parent class.
Class Method Details
.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 |