Sha256: 549da4328b67a4a904381a606ce282effc61b693157309f38f5dfa3f83002248

Contents?: true

Size: 456 Bytes

Versions: 10

Compression:

Stored size: 456 Bytes

Contents

class Module

  # Returns the name of module's container module.
  #
  #   module ::SpaceName
  #     class Example
  #     end
  #   end
  #
  #   SpaceName::Example.name         #=> "SpaceName::Example"
  #   SpaceName::Example.spacename    #=> "SpaceName"
  #
  # 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 9 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 lib/core/facets/module/spacename.rb
facets-3.1.0 lib/core/facets/module/spacename.rb
facets-3.0.0 lib/core/facets/module/spacename.rb
facets-2.9.3 lib/core/facets/module/spacename.rb
facets-2.9.2 lib/core/facets/module/spacename.rb
facets-2.9.2 src/core/facets/module/spacename.rb
facets-2.9.1 lib/core/facets/module/spacename.rb
facets-2.9.0 lib/core/facets/module/spacename.rb
facets-2.9.0.pre.2 lib/core/facets/module/spacename.rb
facets-2.9.0.pre.1 lib/core/facets/module/spacename.rb