77件ヒット
[1-77件を表示]
(0.079秒)
種類
- モジュール関数 (33)
- 関数 (22)
- インスタンスメソッド (11)
- 文書 (11)
ライブラリ
- ビルトイン (43)
-
minitest
/ unit (1)
クラス
- UncaughtThrowError (10)
モジュール
- Kernel (33)
-
MiniTest
:: Assertions (1)
キーワード
- Ruby用語集 (11)
-
assert
_ throws (1) - catch (22)
-
rb
_ f _ throw (11) -
rb
_ throw (11) -
to
_ s (10)
検索結果
先頭5件
-
Kernel
. # throw(tag , value = nil) -> () (18229.0) -
Kernel.#catchとの組み合わせで大域脱出を行います。 throw は同じ tag を指定した catch のブロックの終わりまでジャンプします。
...Kernel.#catchとの組み合わせで大域脱出を行います。 throw
は同じ tag を指定した catch のブロックの終わりまでジャンプします。
throw は探索時に呼び出しスタックをさかのぼるので、
ジャンプ先は同じメソッド内にあるとは限......#object_id が同じであるという意味です。
@param tag catch の引数に対応する任意のオブジェクトです。
@param value catch の戻り値になります。
@raise ArgumentError 同じ tag で待っている catch が存在しない場合に発生します。
//emlist[例]......[ruby]{
def foo
throw :exit, 25
end
ret = catch(:exit) do
begin
foo
some_process() # 絶対に実行されない
10
ensure
puts "ensure"
end
end
puts ret
#=> ensure
# 25
//}
@see Kernel.#catch......ject_id が同じであるという意味です。
@param tag catch の引数に対応する任意のオブジェクトです。
@param value catch の戻り値になります。
@raise UncaughtThrowError 同じ tag で待っている catch が存在しない場合に発生します。
//emlist[......例][ruby]{
def foo
throw :exit, 25
end
ret = catch(:exit) do
begin
foo
some_process() # 絶対に実行されない
10
ensure
puts "ensure"
end
end
puts ret
#=> ensure
# 25
//}
@see Kernel.#catch... -
MiniTest
:: Assertions # assert _ throws(tag , message = nil) { . . . } -> true (9234.0) -
与えられたブロックを評価中に、与えられたタグが Kernel.#throw された場合、検査にパスしたことになります。
...与えられたブロックを評価中に、与えられたタグが Kernel.#throw された場合、検査にパスしたことになります。
@param tag 与えられたブロック評価中に Kernel.#throw されるタグを任意のオブジェクトとして指定します。
@param mess......ージを指定します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。
@raise MiniTest::Assertion 与えられたタグが Kernel.#throw されなかった場合に発生します。
@see Kernel.#throw... -
void rb
_ throw(const char *tag , VALUE val) (6216.0) -
throw の実体。返り値を val として、 tag を catch したところまでジャンプします。
...
throw の実体。返り値を val として、
tag を catch したところまでジャンプします。
rb_catch も参照してください。... -
static VALUE rb
_ f _ throw(int argc , VALUE *argv) (6200.0) -
-
UncaughtThrowError
# to _ s -> String (3112.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
//}... -
Kernel
. # catch {|tag| . . . . } -> object (52.0) -
Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
...Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
ブロックの実行中に tag と同一のオブジェクトを引数とする Kernel.#throw が行われた
場合は、その throw の第二引数を戻り値として、ブロック......@return ブロックの返り値か、対応するthrowの第二引数を返り値として返します。
//emlist[例][ruby]{
result = catch do |tag|
for i in 1..2
for j in 1..2
for k in 1..2
throw tag, k
end
end
end
end
p result #=> 1
//}
@see Kernel.#throw... -
Kernel
. # catch(tag) {|tag| . . . . } -> object (52.0) -
Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
...Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
ブロックの実行中に tag と同一のオブジェクトを引数とする Kernel.#throw が行われた
場合は、その throw の第二引数を戻り値として、ブロック......@return ブロックの返り値か、対応するthrowの第二引数を返り値として返します。
//emlist[例][ruby]{
result = catch do |tag|
for i in 1..2
for j in 1..2
for k in 1..2
throw tag, k
end
end
end
end
p result #=> 1
//}
@see Kernel.#throw... -
Ruby用語集 (52.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...Ruby用語集
A B C D E F G I J M N O R S Y
a ka sa ta na ha ma ya ra wa
=== 記号・数字
: %記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。
参照:d:spec/literal#percent
: 0 オリジン
: zero-ba......sed
番号が 0 から始まること。
例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。
: 1 オリジン
: one-based
番号が 1 から始まること。
例えば、
エラ......クテスト
===[a:ta] た
: 大域脱出
: non-local exit
Ruby においては、例外の発生もしくは Kernel.#throw によって
処理の実行が中断されること。
例外の場合は begin/rescue によって、throw の場合は
Kernel.#catch によって捕捉されるま...