るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.078秒)
トップページ > クエリ:String[x] > 種類:インスタンスメソッド[x] > クエリ:string[x] > クエリ:param[x] > クエリ:protected[x] > クエリ:protected_method_defined?[x]

別のキーワード

  1. _builtin protected
  2. module protected
  3. _builtin protected_method_defined?
  4. module protected_method_defined?
  5. _builtin protected_instance_methods

ライブラリ

クラス

検索結果

Module#protected_method_defined?(name, inherit=true) -> bool (24296.0)

インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が protected であるときに true を返します。 そうでなければ false を返します。

...モジュールに定義されており、
しかもその可視性が protected であるときに true を返します。
そうでなければ false を返します。

@param name Symbol か String を指定します。
@param inherit 真を指定するとスーパークラスや include した...
...nd
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.protected_method_defined? "method2...
...", true #=> true
C.protected_method_defined? "method2", false #=> false
C.method_defined? "method2" #=> true
//}...