るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.157秒)
トップページ > クエリ:E[x] > クエリ:Template[x] > クラス:Object[x]

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix det_e
  4. matrix rank_e
  5. open3 capture2e

ライブラリ

検索結果

Object#respond_to?(name, include_all = false) -> bool (6161.0)

オブジェクトがメソッド name を持つとき真を返します。

...ド name を持つとき真を返します。

オブジェクトが メソッド name を持つというのは、
オブジェクトが メソッド name に応答できることをいいます。

Windows での Process.fork や GNU/Linux での File.lchmod の
ような NotImplementedError が発...
...plementedError が発生する場合は true を返します。

メソッドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。

@param name Symbol または文字列で指定するメソッド名です。

@param include_all private...
...hello
"Bonjour"
e
nd
e
nd

class D
private
def hello
"Guten Tag"
e
nd
e
nd
list = [F.new,D.new]

list.each{|it| puts it.hello if it.respond_to?(:hello)}
#=> Bonjour

list.each{|it| it.instance_eval("puts hello if it.respond_to?(:hello, true)")}
#=> Bonjour
# Guten Tag

module Template...