public_method_defined?

public_method_defined?

ri

 ------------------------------------------ Module#public_method_defined?
      mod.public_method_defined?(symbol)   => true or false
 ------------------------------------------------------------------------
      Returns  true  if the named public method is defined by _mod_ (or
      its included modules and, if _mod_ is a class, its ancestors).
 
         module A
           def method1()  end
         end
         class B
           protected
           def method2()  end
         end
         class C < B
           include A
           def method3()  end
         end
      
         A.method_defined? :method1           #=> true
         C.public_method_defined? "method1"   #=> true
         C.public_method_defined? "method2"   #=> false
         C.method_defined? "method2"          #=> true
 

refe

 Module#public_method_defined?
 --- private_method_defined?(name)
 --- protected_method_defined?(name)
 --- public_method_defined?(name)
 
     ruby 1.7 feature
 
     それぞれ、private, protected,
     public であるインスタンスメソッド name がモジュー
     ルに定義されているとき真を返します。nameSymbol か
     文字列です。
 
     Module#method_defined? [Module/method_defined?]
     も参照してください。