Class: Dependencies::RootLoadingModule

Inherits:
LoadingModule show all
Defined in:
lib/active_support/dependencies.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LoadingModule

#const_available?, #const_load!, #const_missing, root, #root?

Methods inherited from Module

#const_missing, #mattr_accessor, #mattr_reader, #mattr_writer, #rails_original_const_missing

Constructor Details

#initialize(*paths) ⇒ RootLoadingModule

Returns a new instance of RootLoadingModule.



123
124
125
# File 'lib/active_support/dependencies.rb', line 123

def initialize(*paths)
  @load_paths = paths.flatten.collect {|p| p.kind_of?(ConstantLoadPath) ? p : ConstantLoadPath.new(p)}
end

Instance Attribute Details

#load_pathsObject (readonly)

Returns the value of attribute load_paths.



121
122
123
# File 'lib/active_support/dependencies.rb', line 121

def load_paths
  @load_paths
end

Instance Method Details

#clear!Object

Erase all items in this module



137
138
139
140
141
142
# File 'lib/active_support/dependencies.rb', line 137

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



132
133
134
# File 'lib/active_support/dependencies.rb', line 132

def load_file!(file_path)
  require_dependency(file_path)
end

#pathObject



129
# File 'lib/active_support/dependencies.rb', line 129

def path() [] end

#rootObject



127
# File 'lib/active_support/dependencies.rb', line 127

def root() self end