Sha256: 305d2f3145bc9f643be0cd18584f90627641349f9e6512d701fded6e6a059f89
Contents?: true
Size: 415 Bytes
Versions: 6
Compression:
Stored size: 415 Bytes
Contents
class Module # Returns the name of module's container module. # # module Example # class Demo # end # end # # Demo.name #=> "Example::Demo" # Demo.spacename #=> "Example" # # This used to be called +dirname+. # # See also Module#basename. # # CREDIT: Trans def spacename name[0...(name.rindex('::') || 0)] #name.gsub(/::[^:]*$/, '') end end
Version data entries
6 entries across 6 versions & 2 rubygems