るりまサーチ

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

別のキーワード

  1. objectspace each_object
  2. _builtin each_object
  3. object send
  4. object to_enum
  5. json object

ライブラリ

検索結果

Fiber.yield(*arg = nil) -> object (203.0)

現在のファイバーの親にコンテキストを切り替えます。

...す。

コンテキストの切り替えの際に Fiber#resume に与えられた引数を yield メソッドは返します。

@param arg 現在のファイバーの親に渡したいオブジェクトを指定します。

@raise FiberError Fiber でのルートファイバーで呼ばれた場...
...合に発生します。


//emlist[例:][ruby]{
a = nil
f = Fiber.new do
a = Fiber.yield()
end

f.resume()
f.resume(:foo)

p a #=> :foo
//}...