method
qualified_const_defined?
rails latest stable - Class:
Dependencies
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v2.1.0) is shown here.
qualified_const_defined?(path)public
Is the provided constant path defined?
# File activesupport/lib/active_support/dependencies.rb, line 114
def qualified_const_defined?(path)
raise NameError, "#{path.inspect} is not a valid constant name!" unless
/^(::)?([A-Z]\w*)(::[A-Z]\w*)*$/ =~ path
names = path.to_s.split('::')
names.shift if names.first.empty?
# We can't use defined? because it will invoke const_missing for the parent
# of the name we are checking.
names.inject(Object) do |mod, name|
return false unless uninherited_const_defined?(mod, name)
mod.const_get name
end
return true
end Related methods
- Instance methods
- associate_with
- autoload_module!
- autoloadable_module?
- autoloaded?
- clear
- depend_on
- load?
- load_file
- load_missing_constant
- load_once_path?
- loadable_constants_for_path
- mark_for_unload
- new_constants_in
- qualified_const_defined?
- qualified_name_for
- remove_constant
- remove_unloadable_constants!
- require_or_load
- search_for_file
- to_constant_name
- uninherited_const_defined?
- uninherited_const_defined?
- will_unload?
- Protected methods
-
log -
log_call