るりまサーチ

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

別のキーワード

  1. argf.class each
  2. argf.class each_line
  3. argf.class lines
  4. argf.class readlines
  5. argf.class gets

ライブラリ

クラス

検索結果

Object#public_method(name) -> Method (18126.0)

オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。

... String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、 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_method...

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

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

...かもその可視性が public であるときに true を返します。
そうでなければ false を返します。

@param name Symbol か String を指定します。
@param inherit 真を指定するとスーパークラスや include したモジュールで
定義されたメソッ...
...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 (25.0)

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

...e を返します。

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

@see Module#public_method_defined?, Module#private_method_defined?, M...
...[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? :method1 #=> true
C.method...

Module#private_method_defined?(name, inherit=true) -> bool (25.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? "metho...

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

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

...す。

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

@see Module#method_defined?, Module#public_method_defined?, Module#private_method_d...
...efined?

//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_defined? "m...

絞り込み条件を変える