Sha256: 7907c05ced50d00bd1152861a1bf15a6d0435936e954a91e7145c78ff11be43f
Contents?: true
Size: 704 Bytes
Versions: 22
Compression:
Stored size: 704 Bytes
Contents
#require 'facet/module/dirname' #require 'facet/kernel/constant' class Module # Returns the module's container module. # # module Example # class Demo # end # end # # Demo.modspace #=> Example # # See also Module#basename. # def modspace eval self.name[ 0...self.name.rindex( '::' ) ] end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCModule < Test::Unit::TestCase def test_modspace assert_equal( Test::Unit, Test::Unit::TestCase.modspace ) assert_equal( ::Test::Unit, ::Test::Unit::TestCase.modspace ) end end =end
Version data entries
22 entries across 22 versions & 1 rubygems