るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.048秒)
トップページ > クエリ:Method[x] > クエリ:name[x] > クエリ:respond_to?[x]

別のキーワード

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

ライブラリ

クラス

検索結果

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

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

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

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

Windows での Process.fork や GNU/Linux での File.lchmod の
...
...t.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

def start
puts "start"
end

def template_method
raise Not...
...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...

ruby 1.8.4 feature (90.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...[bug]>))
* ((<ruby 1.8.4 feature/シグナル [bug]>))
* ((<ruby 1.8.4 feature/組み込みライブラリ>))
* ((<ruby 1.8.4 feature/UnboundMethod#bind [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [change]>))
* ((<ruby 1.8.4 feature/prin...
...)
* ((<ruby 1.8.4 feature/File.basename [change]>))
* ((<ruby 1.8.4 feature/File.dirname [change]>))
* ((<ruby 1.8.4 feature/Dir.glob (Win全般) [bug]>))
* ((<ruby 1.8.4 feature/File.basename (Win全般) [change]>))
* ((<ruby 1.8.4 feature/File.dirname (Win全般) [bug]>))
* ((<ruby 1.8...
...(rb_obj_respond_to): check if obj responds to the given
# method with the given visibility. [ruby-dev:27408]
#
# * eval.c (rb_respond_to): conform to Object#respond_to?. [ruby-dev:27411]

rb_respond_to()をObject#respond_to?のデフォルトの動作と同じ(public
メソ...