protected_method_defined?

protected_method_defined?

ri

 --------------------------------------- Module#protected_method_defined?
      mod.protected_method_defined?(symbol)   => true or false
 ------------------------------------------------------------------------
      Returns  true  if the named protected 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.protected_method_defined? "method1"   #=> false
         C.protected_method_defined? "method2"   #=> true
         C.method_defined? "method2"             #=> true
 

refe

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