2件ヒット
[1-2件を表示]
(0.106秒)
検索結果
-
Enumerator
# rewind -> self (63385.0) -
列挙状態を巻き戻します。
...が rewind メソッドを持つとき(respond_to?(:rewind) に
真を返すとき) は、その rewind メソッドを呼び出します。
@see Enumerator#next
//emlist[例][ruby]{
str = "xyz"
enum = str.each_byte
p enum.next # => 120
p enum.next # => 121
enum.rewind
p enum.next # => 120
//}... -
Enumerator
# next -> object (9028.0) -
「次」のオブジェクトを返します。
...用を
伴っている場合には影響があり得ます。
@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...