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

Version Path
facets-2.8.4 lib/core/facets/module/spacename.rb
facets-2.8.3 lib/core/facets/module/spacename.rb
facets-2.8.2 lib/core/facets/module/spacename.rb
facets-2.8.1 lib/core/facets/module/spacename.rb
facets-2.8.0 lib/core/facets/module/spacename.rb
facets-2.7.0 lib/core/facets/module/spacename.rb
facets-2.6.0 lib/core/facets/module/spacename.rb
facets-2.5.1 lib/core/facets/module/spacename.rb
facets-2.5.0 lib/core/facets/module/spacename.rb
facets-2.5.2 lib/core/facets/module/spacename.rb