別のキーワード
キーワード
-
method
_ defined? (11) -
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) -
public
_ instance _ method (11) -
public
_ method _ defined? (11) -
public
_ methods (11)
検索結果
先頭5件
-
Module
# public _ method _ defined?(name , inherit=true) -> bool (27151.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......ed? :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
# public _ method _ defined?(name) -> bool (27139.0) -
インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が public であるときに true を返します。 そうでなければ false を返します。
...れば false を返します。
@param name Symbol か String を指定します。
@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
inclu......de A
def method3() end
end
A.method_defined? :method1 #=> true
C.public_method_defined? "method1" #=> true
C.public_method_defined? "method2" #=> false
C.method_defined? "method2" #=> true
//}... -
Module
# method _ defined?(name) -> bool (21032.0) -
モジュールにインスタンスメソッド name が定義されており、 かつその可視性が public または protected であるときに true を返します。
...に
true を返します。
@param name Symbol か 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... -
Module
# method _ defined?(name , inherit=true) -> bool (21032.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
# private _ method _ defined?(name) -> bool (21032.0) -
インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が private であるときに true を返します。 そうでなければ false を返します。
...れば false を返します。
@param name Symbol か 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... -
Module
# private _ method _ defined?(name , inherit=true) -> bool (21032.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
# protected _ method _ defined?(name) -> bool (21032.0) -
インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が protected であるときに true を返します。 そうでなければ false を返します。
...ければ false を返します。
@param name Symbol か 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
inclu... -
Module
# protected _ method _ defined?(name , inherit=true) -> bool (21032.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
# public _ instance _ method(name) -> UnboundMethod (21020.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... -
Object
# public _ method(name) -> Method (18121.0) -
オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。
...vate メソッド名を引数として与えると発生します。
//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_method... -
Object
# public _ methods(include _ inherited = true) -> [Symbol] (6108.0) -
そのオブジェクトが理解できる public メソッド名の一覧を返します。
...が理解できる public メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#public_instance_methods,Object#methods,Object#singleton_methods...