diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/loading.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/loading.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/loading.rb b/activesupport/lib/active_support/core_ext/module/loading.rb index 36c0c61405..4b4b110b25 100644 --- a/activesupport/lib/active_support/core_ext/module/loading.rb +++ b/activesupport/lib/active_support/core_ext/module/loading.rb @@ -1,4 +1,14 @@ class Module + # Returns String#underscore applied to the module name minus trailing classes. + # + # ActiveRecord.as_load_path # => "active_record" + # ActiveRecord::Associations.as_load_path # => "active_record/associations" + # ActiveRecord::Base.as_load_path # => "active_record" (Base is a class) + # + # The Kernel module gives an empty string by definition. + # + # Kernel.as_load_path # => "" + # Math.as_load_path # => "math" def as_load_path if self == Object || self == Kernel '' |