50件ヒット
[1-50件を表示]
(0.036秒)
別のキーワード
検索結果
先頭5件
-
UncaughtThrowError (38008.0)
-
Kernel.#throw に指定した tag に対して一致する Kernel.#catch が存在しない場合に発生します。
...Kernel.#throw に指定した tag に対して一致する
Kernel.#catch が存在しない場合に発生します。
throw "foo", "bar"
# => (例外発生) UncaughtThrowError: uncaught throw "foo"... -
UncaughtThrowError
# tag -> object (21008.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 (21008.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
//}... -
UncaughtThrowError
# value -> object (21008.0) -
Kernel.#throw に指定した value を返します。
...Kernel.#throw に指定した value を返します。
//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label, "uncaught_value"
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.value # => "uncaught_value"
end
//}... -
Kernel
. # throw(tag , value = nil) -> () (8.0) -
Kernel.#catchとの組み合わせで大域脱出を行います。 throw は同じ tag を指定した catch のブロックの終わりまでジャンプします。
...。
@param tag catch の引数に対応する任意のオブジェクトです。
@param value catch の戻り値になります。
@raise UncaughtThrowError 同じ tag で待っている catch が存在しない場合に発生します。
//emlist[例][ruby]{
def foo
throw :exit, 25
end
ret =...