private_method_defined?

private_method_defined?

ri

 ----------------------------------------- Module#private_method_defined?
      mod.private_method_defined?(symbol)    => true or false
 ------------------------------------------------------------------------
      Returns  true  if the named private 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
           private
           def method2()  end
         end
         class C < B
           include A
           def method3()  end
         end
      
         A.method_defined? :method1            #=> true
         C.private_method_defined? "method1"   #=> false
         C.private_method_defined? "method2"   #=> true
         C.method_defined? "method2"           #=> false
 

refe

 Module#private_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?]
     も参照してください。