
class Module

  # Is a given class or module an ancestor of
  # this class or module?
  #
  #  class X ; end
  #  class Y < X ; end
  #
  #   X.ancestor?(Y)
  #
  def ancestor?( mod )
    ancestors.include? mod
  end

end



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

  require 'test/unit'

  class TCModule < Test::Unit::TestCase

    def test_ancestor
      assert( self.class.ancestor?(::Test::Unit::TestCase) )
    end

  end

=end
