Sha256: 93f5d11a4ee7f71132d9a0c5e47007fbc1dbc6949c9a262bc831b44f36405522
Contents?: true
Size: 414 Bytes
Versions: 10
Compression:
Stored size: 414 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
10 entries across 10 versions & 1 rubygems