31件ヒット
[1-31件を表示]
(0.039秒)
別のキーワード
クラス
- Object (11)
- UncaughtThrowError (20)
キーワード
-
respond
_ to? (11) -
to
_ s (10)
検索結果
先頭3件
-
UncaughtThrowError
# tag -> object (18126.0) -
Kernel.#throw に指定した tag を返します。
...Kernel.#throw に指定した tag を返します。
//emlist[例:][ruby]{
def do_complicated_things
throw :uncaught_label
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.tag # => ":uncaught_label"
end
//}... -
UncaughtThrowError
# to _ s -> String (19.0) -
self を tag を含む文字列表現にして返します。
...self を tag を含む文字列表現にして返します。
//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.to_s # => "uncaught throw :uncaught_label"
end
//}... -
Object
# respond _ to?(name , include _ all = false) -> bool (15.0) -
オブジェクトがメソッド name を持つとき真を返します。
...end
class D
private
def hello
"Guten Tag"
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
t...