ライブラリ
- ビルトイン (55)
キーワード
-
method
_ defined? (11) -
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) -
public
_ method _ defined? (11)
検索結果
先頭5件
-
Object
# public _ method(name) -> Method (26119.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 (14137.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
# public _ method _ defined?(name) -> bool (14125.0) -
インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が public であるときに true を返します。 そうでなければ false を返します。
...][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? "method2" #=> false
C.met... -
Module
# method _ defined?(name) -> bool (8018.0) -
モジュールにインスタンスメソッド name が定義されており、 かつその可視性が public または protected であるときに true を返します。
...String を指定します。
@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_method2... -
Module
# method _ defined?(name , inherit=true) -> bool (8018.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) -> bool (8018.0) -
インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が private であるときに true を返します。 そうでなければ false を返します。
...か String を指定します。
@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? :metho... -
Module
# private _ method _ defined?(name , inherit=true) -> bool (8018.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) -> bool (8018.0) -
インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が protected であるときに true を返します。 そうでなければ false を返します。
...か String を指定します。
@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? :metho... -
Module
# protected _ method _ defined?(name , inherit=true) -> bool (8018.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...