るりまサーチ

最速Rubyリファレンスマニュアル検索!
704件ヒット [1-100件を表示] (0.074秒)
トップページ > クエリ:@[x] > クエリ:next[x]

別のキーワード

  1. prime next
  2. _builtin next
  3. date next
  4. date next_day
  5. date next_year

ライブラリ

モジュール

検索結果

<< 1 2 3 ... > >>

Enumerator#next -> object (18149.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...

Symbol#next -> Symbol (18125.0)

シンボルに対応する文字列の「次の」文字列に対応するシンボルを返します。

...シンボルに対応する文字列の「次の」文字列に対応するシンボルを返します。

(self.to_s.next.intern と同じです。)

:a.next # => :b
:foo.next # => :fop

@
see String#succ...

Integer#next -> Integer (18119.0)

self の次の整数を返します。

...self の次の整数を返します。

//emlist[][ruby]{
1.next #=> 2
(-1).next #=> 0
1.succ #=> 2
(-1).succ #=> 0
//}

@
see Integer#pred...

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

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

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

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

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

Enumerator#next_values -> Array (6215.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 列挙状態が既に最後...

絞り込み条件を変える

Float#next_float -> Float (6167.0)

浮動小数点数で表現可能な self の次の値を返します。

....next_float、Float::INFINITY.next_float は
Float::INFINITY を返します。Float::NAN.next_float は
Float::NAN を返します。

//emlist[例][ruby]{
p 0.01.next_float # => 0.010000000000000002
p 1.0.next_float # => 1.0000000000000002
p 100.0.next_float # => 100.00000000000001

p 0.01.next...
..._float - 0.01 # => 1.734723475976807e-18
p 1.0.next_float - 1.0 # => 2.220446049250313e-16
p 100.0.next_float - 100.0 # => 1.4210854715202004e-14

f = 0.01; 20.times { printf "%-20a %s\n", f, f.to_s; f = f.next_float }
# => 0x1.47ae147ae147bp-7 0.01
# 0x1.47ae147ae147cp-7 0.0100000000000000...
...47ae147ae1489p-7 0.010000000000000024
# 0x1.47ae147ae148ap-7 0.010000000000000026
# 0x1.47ae147ae148bp-7 0.010000000000000028
# 0x1.47ae147ae148cp-7 0.01000000000000003
# 0x1.47ae147ae148dp-7 0.010000000000000031
# 0x1.47ae147ae148ep-7 0.010000000000000033
//}

@
see Float#prev_float...

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

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

...が終了するまで待ちます。

@
param nonblock true を与えると、キューが空の時、例外 ThreadsWait::ErrNoFinishedThread が発生します。

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

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

#使用例
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...

Date#next_year(n = 1) -> Date (6125.0)

n 年後を返します。

...します。

//emlist[例][ruby]{
require 'date'
Date.new(2001,2,3).next_year #=> #<Date: 2002-02-03 ...>
Date.new(2008,2,29).next_year #=> #<Date: 2009-02-28 ...>
Date.new(2008,2,29).next_year(4) #=> #<Date: 2012-02-29 ...>
//}

Date#>> も参照してください。

@
param n 年数...

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

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

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

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