るりまサーチ

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

別のキーワード

  1. _builtin raise
  2. kernel raise
  3. fiber raise
  4. thread raise
  5. e2mmap raise

検索結果

<< 1 2 3 > >>

Enumerator#next -> object (18143.0)

「次」のオブジェクトを返します。

...合は、
StopIteration 例外を発生します。このとき列挙状態は変化しません。
つまりもう一度 next を呼ぶと再び例外が発生します。

next
メソッドによる外部列挙の状態は他のイテレータメソッドによる
内部列挙には影響を与え...
...っている場合には影響があり得ます。

@raise StopIteration 列挙状態が既に最後へ到達しているとき
@see Enumerator#rewind

//emlist[例1][ruby]{
str = "xyz"
enum = str.each_byte

str.bytesize.times do
puts enum.next
end
# => 120
# 121
# 122
//}

//em...
...ist[例2][ruby]{
str = "xyz"
enum = str.each_byte

begin
puts enum.next while true
rescue StopIteration
puts "iteration reached at end"
end
# => 120
# 121
# 122
# iteration reached at end
puts enum.next
#=> 再度 StopIteration 例外が発生
//}

//emlist[例3: Ker...

Prime::PseudoPrimeGenerator#next -> () (18107.0)

次の擬似素数を返します。 また内部的な位置を進めます。

...次の擬似素数を返します。
また内部的な位置を進めます。

サブクラスで実装してください。

@raise NotImplementedError 必ず発生します。...

Enumerator#next_values -> Array (6209.0)

「次」のオブジェクトを配列で返します。

...を配列で返します。

Enumerator#next とほぼ同様の挙動をします。終端まで到達した場合は
StopIteration 例外を発生させます。

このメソッドは、
yield

yield nil
を区別するために使えます。

next
メソッドによる外部列挙の状...
...list[例: next next_values の違いを][ruby]{
o = Object.new
def o.each
yield
yield 1
yield 1, 2
yield nil
yield [1, 2]
end
e = o.to_enum
p e.next_values
p e.next_values
p e.next_values
p e.next_values
p e.next_values
e = o.to_enum
p e.next
p e.next
p e.next
p e.next
p e.next

## yie...
...ld args next_values next
# yield [] nil
# yield 1 [1] 1
# yield 1, 2 [1, 2] [1, 2]
# yield nil [nil] nil
# yield [1, 2] [[1, 2]] [1, 2]
//}

@raise StopIteration 列挙状態が既に最後...

ThreadsWait#next_wait(nonblock = nil) -> Thread (6119.0)

指定したスレッドのどれかが終了するまで待ちます。

...ると、キューが空の時、例外 ThreadsWait::ErrNoFinishedThread が発生します。

@raise ErrNoWaitingThread 終了をまつスレッドが存在しない時、発生します。

@raise ErrNoFinishedThread nonblock がtrue でかつ、キューが空の時、発生します。

#使...
...用例
require 'thwait'

threads = []
2.times {|i|
threads << Thread.new { sleep i }
}

thall = ThreadsWait.new
thall.join_nowait(*threads)
until thall.empty?
th = thall.next_wait
p th
end

@see Queue#pop...

OpenSSL::X509::CRL#next_update=(time) (6113.0)

CRL の次回更新日時を Time オブジェクトで設定します。

...CRL の次回更新日時を Time オブジェクトで設定します。

@param time 最終更新日時
@raise OpenSSL::X509::CRLError 設定に失敗した場合に発生します
@see OpenSSL::X509::CRL#next_update...

絞り込み条件を変える

Prime::PseudoPrimeGenerator#succ -> () (3007.0)

次の擬似素数を返します。 また内部的な位置を進めます。

...次の擬似素数を返します。
また内部的な位置を進めます。

サブクラスで実装してください。

@raise NotImplementedError 必ず発生します。...

制御構造 (176.0)

制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END

...御構造
条件分岐:
* if
* unless
* case
繰り返し:
* while
* until
* for
* break
* next
* redo
* retry
例外処理:
* raise
* begin
その他:
* return
* BEGIN
* END

Rubyでは(Cなどとは異なり)制御構造は式であっ...
...プの戻り値はその引数になります。


====[a:next] next

//emlist[例][ruby]{
# 空行を捨てるcat
ARGF.each_line do |line|
next
if line.strip.empty?
print line
end
//}

文法:

next


next
val


next
はもっとも内側のループの次の繰り返しにジ...
...ャンプします。
イテレータでは、yield 呼び出しの脱出になります。

next
により抜けた yield 式は nil を返します。
ただし、引数を指定した場合、yield 式の戻り値はその引数になります。

====[a:redo] redo

例:

redo


文法:...

Enumerator#peek_values -> Array (76.0)

Enumerator#next_values のように「次」のオブジェクトを 配列で返しますが、列挙状態を変化させません。

...Enumerator#next_values のように「次」のオブジェクトを
配列で返しますが、列挙状態を変化させません。

Enumerator#next, Enumerator#next_values のように
現在までの列挙状態に応じて「次」のオブジェクトを返しますが、
next
と異なり...
...Enumerator#next_values と同様
yield

yield nil
を区別するために使えます。

//emlist[例][ruby]{
o = Object.new
def o.each
yield
yield 1
yield 1, 2
end
e = o.to_enum
p e.peek_values #=> []
e.next
p e.peek_values #=> [1]
p e.peek_values #=> [1]
e.next
p e.peek_va...
...lues #=> [1, 2]
e.next
p e.peek_values # raises StopIteration
//}

@raise StopIteration 列挙状態が既に最後へ到達しているとき
@see Enumerator#next, Enumerator#next_values, Enumerator#peek_values...

Enumerator#peek -> object (54.0)

「次」のオブジェクトを返しますが、列挙状態を変化させません。

...のオブジェクトを返しますが、列挙状態を変化させません。

Enumerator#next のように
現在までの列挙状態に応じて「次」のオブジェクトを返しますが、
next
と異なり列挙状態を変更しません。

列挙が既に最後へ到達している...
...[1,2,3]
e = a.to_enum
p e.next #=> 1
p e.peek #=> 2
p e.peek #=> 2
p e.peek #=> 2
p e.next #=> 2
p e.next #=> 3
p e.next #raises StopIteration
//}

@raise StopIteration 列挙状態が既に最後へ到達しているとき
@see Enumerator#next, Enumerator#next_values, Enumerator#peek_...
<< 1 2 3 > >>