るりまサーチ

最速Rubyリファレンスマニュアル検索!
60件ヒット [1-60件を表示] (0.097秒)

別のキーワード

  1. openssl public_key
  2. openssl public_key=
  3. _builtin public
  4. module public
  5. object public_send

検索結果

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

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

...ます。

@
param name Symbol か String を指定します。
@
param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。

@
see Module#method_defined?, Module#private_method_defined?, Module#protected_me...
...ned?

//emlist[例][ruby]{
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? "method1", true...
...#=> true
C.public_method_defined? "method1", false #=> true
C.public_method_defined? "method2" #=> false
C.method_defined? "method2" #=> true
//}...

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

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

...す。

@
param name Symbol か String を指定します。
@
param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。

@
see Module#public_method_defined?, Module#private_method_defined?, Module#protecte...
...d_method_defined?

//emlist[例][ruby]{
module
A
def method1() end
def protected_method1() end
protected :protected_method1
end
class B
def method2() end
def private_method2() end
private :private_method2
end
class C < B
include A
def method3() end
end

A.method_defined? :method...

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

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

...します。

@
param name Symbol か String を指定します。
@
param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。

@
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
include A
def method3() end
end

A.method_defined? :method1 #=> true
C.private_method_defined? "method1" #=> false
C.private_method_defined?...

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

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

...します。

@
param name Symbol か String を指定します。
@
param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッドも対象になります。

@
see Module#method_defined?, Module#public_method_defined?, Module#private_me...
...thod_defined?

//emlist[例][ruby]{
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_defin...

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

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

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

@
param name メソッド名を Symbol または String で指定します。

@
raise NameError 定義されていないメソッド名や、
protected メソッド名、 private メ...
...として与えると発生します。

//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...

絞り込み条件を変える