るりまサーチ

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

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix det_e
  4. matrix rank_e
  5. open3 capture2e

ライブラリ

検索結果

StopIteration#result -> object (6101.0)

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

...bject = Object.new
def object.each
yield :yield1
yield :yield2
:each_returned
e
nd

e
numerator = object.to_enum

p enumerator.next #=> :yield1
p enumerator.next #=> :yield2

begin
e
numerator.next
rescue StopIteration => error
p error.result #=> :each_returned
e
nd...