Class: Dependencies::RootLoadingModule
- Inherits:
-
LoadingModule
- Object
- Module
- LoadingModule
- Dependencies::RootLoadingModule
- Defined in:
- lib/active_support/dependencies.rb
Instance Attribute Summary collapse
-
#load_paths ⇒ Object
readonly
Returns the value of attribute load_paths.
Instance Method Summary collapse
-
#clear! ⇒ Object
Erase all items in this module.
-
#initialize(*paths) ⇒ RootLoadingModule
constructor
A new instance of RootLoadingModule.
-
#load_file!(file_path) ⇒ Object
Load the source file at the given file path.
- #path ⇒ Object
- #root ⇒ Object
Methods inherited from LoadingModule
#const_available?, #const_load!, #const_missing, root, #root?
Methods inherited from Module
#mattr_accessor, #mattr_reader, #mattr_writer
Constructor Details
#initialize(*paths) ⇒ RootLoadingModule
Returns a new instance of RootLoadingModule.
113 114 115 |
# File 'lib/active_support/dependencies.rb', line 113 def initialize(*paths) @load_paths = paths.flatten.collect {|p| p.kind_of?(ConstantLoadPath) ? p : ConstantLoadPath.new(p)} end |
Instance Attribute Details
#load_paths ⇒ Object (readonly)
Returns the value of attribute load_paths.
111 112 113 |
# File 'lib/active_support/dependencies.rb', line 111 def load_paths @load_paths end |
Instance Method Details
#clear! ⇒ Object
Erase all items in this module
127 128 129 130 131 132 |
# File 'lib/active_support/dependencies.rb', line 127 def clear! constants.each do |name| Object.send(:remove_const, name) if Object.const_defined?(name) && Object.const_get(name).object_id == self.const_get(name).object_id self.send(:remove_const, name) end end |
#load_file!(file_path) ⇒ Object
Load the source file at the given file path
122 123 124 |
# File 'lib/active_support/dependencies.rb', line 122 def load_file!(file_path) require_dependency(file_path) end |
#path ⇒ Object
119 |
# File 'lib/active_support/dependencies.rb', line 119 def path() [] end |