22件ヒット
[1-22件を表示]
(0.074秒)
種類
- クラス (11)
- インスタンスメソッド (11)
クラス
- StopIteration (11)
検索結果
-
StopIteration (52002.0)
-
イテレーションを止めるときに発生する例外です。
イテレーションを止めるときに発生する例外です。 -
StopIteration
# result -> object (32008.0) -
この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。
...ect = Object.new
def object.each
yield :yield1
yield :yield2
:each_returned
end
enumerator = object.to_enum
p enumerator.next #=> :yield1
p enumerator.next #=> :yield2
begin
enumerator.next
rescue StopIteration => error
p error.result #=> :each_returned
end...