
module Kernel

  # Call parent class/module methods once bound to self.

  def send_as( ancestor, sym, *args, &blk )
    ancestor.instance_method(sym).bind(self).call(*args,&blk)
  end

#--
#   def send_as(klass, meth, *args, &blk)
#     selfclass = Kernel.instance_method(:class).bind(self).call
#     raise ArgumentError if ! selfclass.ancestors.include?(klass)
#     klass.instance_method(meth).bind(self).call(*args, &blk)
#   end
#++

end



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

  require 'test/unit'

  class TCKernel < Test::Unit::TestCase

    def test_send_as
      assert_equal( String, "A".send_as(Object, :class) )
    end

  end

=end
