るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.101秒)
トップページ > クエリ:c[x] > 種類:インスタンスメソッド[x] > クラス:StopIteration[x]

別のキーワード

  1. _builtin to_c
  2. etc sc_2_c_dev
  3. etc sc_2_c_bind
  4. tracer display_c_call
  5. tracer display_c_call=

ライブラリ

検索結果

StopIteration#result -> object (102.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
p error.result #=> :each_returned...