るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

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

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

...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

def start
pu...
...t implement template_method
end

puts ImplTemplateMethod.new.respond_to?(:template_method) # => true
# NotImplementedError が発生しているが、Rubyによる実装部のため true を返す
puts NotImplTemplateMethod.new.respond_to?(:template_method) # => true
# GNU/Linux で実行。C言語...

irb/completion (36.0)

irb の completion 機能を提供するライブラリです。

...補完します.

irb(main):001:0> in
in inspect instance_eval
include install_alias_method instance_of?
initialize install_aliases instance_variables
irb(main):001:0> inspect
"main"
irb(main):002:0> foo = Object.new...
...ソッド一覧がでます.

irb(main):003:0> foo.
foo.== foo.frozen? foo.protected_methods
foo.=== foo.hash foo.public_methods
foo.=~ foo.id foo.respond_to?
foo.__id__ foo.inspect...

NEWS for Ruby 2.0.0 (24.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ルディスクリプタを閉じます
:close_others オプションのデフォルト値を true に変更しました
* 非互換: respond_to? は protected なメソッドに対して false を返します。第2引数に true を指定すると true を返します。
* 非互換:...
...of set_trace_func.
Easy to use and efficient implementation.

* toplevel
* added method:
* added main.define_method which defines a global function.
* added main.using, which imports refinements into the current file or
eval string. [experimental]

=== 組み込み...
...ors.
This means file descriptors doesn't inherit to spawned process unless
explicitly requested such as system(..., fd=>fd).

* Kernel#respond_to? against a protected method now returns false
unless the second argument is true.

* Object#respond_to_missing?, Object#initialize_clone,...