
module Kernel

  # Easy access to an object qua class, otherwise known
  # as the object's metaclass or singleton class. This
  # implemnetation alwasy returns the class, even if a
  # block is provided to eval against it.
  #
  #     It is what it is.
  #
  #               -- transonoma

  def instance_class( &block )
    (class << self; self; end).module_eval(&block) if block
    (class << self; self; end)
  end

end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCKernel < Test::Unit::TestCase

    def test_instance_class
      o = Object.new
      assert_equal( (class << o; self; end), o.instance_class )
    end

  end

=end
