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

Constructor Details

#initialize(*paths) ⇒ RootLoadingModule


117
118
119
# File 'lib/active_support/dependencies.rb', line 117

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


115
116
117
# File 'lib/active_support/dependencies.rb', line 115

def load_paths
  @load_paths
end

Instance Method Details

#clear!Object

Erase all items in this module


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

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


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

def load_file!(file_path)
  require_dependency(file_path)
end

#pathObject


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

def path() [] end

#rootObject


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

def root() self end