るりまサーチ

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

別のキーワード

  1. ftp ls
  2. net/ftp ls
  3. ls net/ftp
  4. ls net::ftp
  5. ls

ライブラリ

クラス

検索結果

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

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

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

※ NotImplementedError が発生する場合に false を返すのは
Rubyの組み込みライブラリや標準ライブラリなど、C言語で実装されて...
...private メソッドと protected メソッドを確認の対象に
含めるかを true か false で指定します。省略した場合
は false(含めない) を指定した事になります。

//emlist[][ruby]{
class F
def hello
"Bonjour"
end
en...
...lo 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
NotImple...