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

Version Path
facets-2.4.1 lib/facets/module/spacename.rb
facets-2.4.2 lib/core/facets/module/spacename.rb
facets-2.4.3 lib/core/facets/module/spacename.rb
facets-2.4.4 lib/core/facets/module/spacename.rb
facets-2.4.5 lib/core/facets/module/spacename.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/module/spacename.rb