るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
6件ヒット [1-6件を表示] (0.022秒)
トップページ > クラス:Module[x] > クエリ:name[x] > バージョン:2.6.0[x] > クエリ:protected[x]

別のキーワード

  1. _builtin name
  2. resolv each_name
  3. net/imap name
  4. openssl name
  5. win32ole name

検索結果

Module#protected(*name) -> self (54730.0)

メソッドを protected に設定します。

...に設定します。

可視性については d:spec/def#limit を参照して下さい。

@param name 0 個以上の String または Symbol を指定します。

@raise NameError 存在しないメソッド名を指定した場合に発生します。


@see Module#protected_method_defined?...

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

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

...したモジュールで
定義されたメソッドも対象になります。

@see Module#method_defined?, Module#public_method_defined?, Module#private_method_defined?

//emlist[例][ruby]{
module
A
def method1() end
end
class B
protected
def method2() end
end
class C < B
inclu...

Module#method_defined?(name, inherit=true) -> bool (511.0)

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

...モジュールで
定義されたメソッドも対象になります。

@see Module#public_method_defined?, Module#private_method_defined?, Module#protected_method_defined?

//emlist[例][ruby]{
module
A
def method1() end
def protected_method1() end
protected :protected_method1
end...

Module#public_method_defined?(name, inherit=true) -> bool (409.0)

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

...たモジュールで
定義されたメソッドも対象になります。

@see Module#method_defined?, Module#private_method_defined?, Module#protected_method_defined?

//emlist[例][ruby]{
module
A
def method1() end
end
class B
protected
def method2() end
end
class C < B
includ...

Module#private_method_defined?(name, inherit=true) -> bool (391.0)

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

...したモジュールで
定義されたメソッドも対象になります。

@see Module#method_defined?, Module#public_method_defined?, Module#protected_method_defined?

//emlist[例][ruby]{
module
A
def method1() end
end
class B
private
def method2() end
end
class C < B
includ...

絞り込み条件を変える

Module#public_instance_method(name) -> UnboundMethod (391.0)

self の public インスタンスメソッド name をオブジェクト化した UnboundMethod を返します。

...として与えると発生します。

//emlist[例][ruby]{
Kernel.public_instance_method(:object_id) #=> #<UnboundMethod: Kernel#object_id>
Kernel.public_instance_method(:p) # method `p' for module `Kernel' is private (NameError)
//}

@see Module#instance_method,Object#public_method...