2 # Returns String#underscore applied to the module name minus trailing classes.
4 # ActiveRecord.as_load_path # => "active_record"
5 # ActiveRecord::Associations.as_load_path # => "active_record/associations"
6 # ActiveRecord::Base.as_load_path # => "active_record" (Base is a class)
8 # The Kernel module gives an empty string by definition.
10 # Kernel.as_load_path # => ""
11 # Math.as_load_path # => "math"
13 if self == Object
|| self == Kernel
16 parent
== self ? '' : parent
.as_load_path
18 name
.split('::').collect
do |word
|