るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. _builtin stopiteration
  2. loop stopiteration
  3. stopiteration _builtin
  4. peek stopiteration

クラス

検索結果

StopIteration#result -> object (81349.0)

この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。

この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。

object = 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
...