るりまサーチ

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

別のキーワード

  1. _builtin include?
  2. socket mcast_include
  3. ipaddr include?
  4. sdbm include?
  5. dbm include?

ライブラリ

クラス

検索結果

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

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

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

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

@param include_all private メソッドと protected メソッドを確認の対象に
含めるかを true か false で指定します。...
...lo)}
#=> 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

def start
puts "start"
end

def template_method
raise NotImplementedError.new
end...
...sh"
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
# NotImplementedError...