Sha256: f733a532688dff47cd105d0e24cd781fb0c11fb93e8053edf64ef91737d4d454

Contents?: true

Size: 344 Bytes

Versions: 10

Compression:

Stored size: 344 Bytes

Contents

class Module

  # Returns the module's container module.
  #
  #   module Example
  #     class Demo
  #     end
  #   end
  #
  #   Example::Demo.modspace   #=> Example
  #
  # See also Module#basename.
  #
  # CREDIT: Trans

  def modspace
    space = name[ 0...(name.rindex( '::' ) || 0)]
    space.empty? ? Object : eval(space)
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

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