るりまサーチ

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

別のキーワード

  1. _builtin main
  2. main define_method
  3. main public
  4. main private

ライブラリ

クラス

検索結果

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

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

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

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

@param include_all private メソッドと protected メソッドを確認の対象に
含めるかを true か false で指定します。...
...# 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_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による実装部のため true を返す
puts NotI...