60件ヒット
[1-60件を表示]
(0.123秒)
ライブラリ
- ビルトイン (60)
キーワード
-
method
_ defined? (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
public
_ method _ defined? (12)
検索結果
先頭5件
-
Object
# public _ method(name) -> Method (18120.0) -
オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。
...、 private メソッド名を引数として与えると発生します。
//emlist[][ruby]{
1.public_method(:to_int) #=> #<Method: Integer#to_int>
1.public_method(:p) # method `p' for class `Integer' is private (NameError)
//}
@see Object#method,Object#public_send,Module#public_instance_m... -
Module
# public _ method _ defined?(name , inherit=true) -> bool (6138.0) -
インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が public であるときに true を返します。 そうでなければ false を返します。
...ethod1() 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? "metho......d1", false #=> true
C.public_method_defined? "method2" #=> false
C.method_defined? "method2" #=> true
//}... -
Module
# method _ defined?(name , inherit=true) -> bool (19.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
class B
def method2() end
def private_method... -
Module
# private _ method _ defined?(name , inherit=true) -> bool (19.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
include A
def method3() end
end
A.method_defined? :method1... -
Module
# protected _ method _ defined?(name , inherit=true) -> bool (19.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
include A
def method3() end
end
A.method_defined? :method1...