
module Kernel

  private

  # Returns the method object of the current method.
  def this
    name = /\`([^\']+)\'/.match(caller(1).first)[1]
    return method(name)
  end

end


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

  require 'test/unit'

  class TCKernel < Test::Unit::TestCase

    def test_this
      assert_equal( this, method(:test_this) )
    end

  end

=end
