るりまサーチ

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file atime
  4. file mtime
  5. base file

クラス

検索結果

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

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

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

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

※ NotImplementedError が発生する場合に false...
...njour
# Guten Tag

module Template
def main
start
template_method
finish

end

def start
puts "start"
end

def template_method
raise NotImplementedError.new
end

def finish
puts "finish"
end
end

class ImplTemplateMethod
include Template
def template_meth...
...生しているが、Rubyによる実装部のため true を返す
puts NotImplTemplateMethod.new.respond_to?(:template_method) # => true
# GNU/Linux で実行。C言語による実装部のため false を返す
puts File.respond_to?(:lchmod) # => false
//}

@see Module#method_defined?...