11件ヒット
[1-11件を表示]
(0.036秒)
別のキーワード
検索結果
-
Object
# respond _ to?(name , include _ all = false) -> bool (33.0) -
オブジェクトがメソッド name を持つとき真を返します。
...ることをいいます。
Windows での Process.fork や GNU/Linux での File.lchmod の
ような NotImplementedError が発生する場合は false を返します。
※ NotImplementedError が発生する場合に false を返すのは
Rubyの組み込みライブラリや標準ライブ......実装されているメソッドのみです。
Rubyで実装されたメソッドで NotImplementedError が発生する場合は true を返します。
メソッドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。
@param name Sy......dule 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 templ...