module Kernel # Easy access to an object qua class, otherwise # known as the object's metaclass or singleton class. # # It is what it is. # # -- transonoma def quaclass( &block ) (class << self; self; end).module_eval(&block) if block (class << self; self; end) end alias_method :__quaclass__, :quaclass end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCKernel < Test::Unit::TestCase def test_singleton o = Object.new assert_equal( (class << o; self; end), o.quaclass ) end end =end