1件ヒット
[1-1件を表示]
(0.034秒)
クラス
検索結果
-
Enumerator
:: Yielder # to _ proc -> Proc (63412.0) -
Enumerator.new で使うメソッドです。
Enumerator.new で使うメソッドです。
引数を Enumerator::Yielder#yield に渡す Proc を返します。
これは Enumerator::Yielder オブジェクトを他のメソッドにブロック引数と
して直接渡すために使えます。
//emlist[例][ruby]{
text = <<-END
Hello
こんにちは
END
enum = Enumerator.new do |y|
text.each_line(&y)
end
enum.each do |line|
p line
end
# => "Hello\n"
# "こんにちは...