るりまサーチ

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

別のキーワード

  1. win32ole ole_respond_to?
  2. delegate respond_to?
  3. _builtin respond_to?
  4. object respond_to?
  5. delegator respond_to?

ライブラリ

クラス

検索結果

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

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

...o_missing? を呼
び出してその結果を返します。

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

@param include_all private メソッドと protected メソッドを確認の対象に
含めるかを true か false で指定します。...
...private
def hello
"Guten Tag"
end
end
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
def main
start
template_method...
..."finish"
end
end

class ImplTemplateMethod
include
Template
def template_method
"implement template_method"
end
end

class NotImplTemplateMethod
include
Template

# not implement template_method
end

puts ImplTemplateMethod.new.respond_to?(:template_method) # => true
# NotImplemente...