Sha256: e1a5a0375adfc88181a156691cbde4d9b72f5b559be963edbf4c110392e8f31b
Contents?: true
Size: 607 Bytes
Versions: 14
Compression:
Stored size: 607 Bytes
Contents
module Kernel # Access to an object's "special" class, otherwise # known as it's eigenclass or metaclass or own, etc. # # One day these names must be reconciled! def singleton_class (class << self; self; end) end alias_method :__singleton_class__, :singleton_class end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCKernel < Test::Unit::TestCase def test_singleton o = Object.new assert_equal( (class << o; self; end), o.singleton_class ) end end =end
Version data entries
14 entries across 14 versions & 1 rubygems