るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.037秒)
トップページ > クラス:Enumerator[x] > バージョン:2.2.0[x] > クエリ:enumerator[x] > クエリ:with_object[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. matrix each_with_index
  2. _builtin with_index
  3. mkmf with_werror
  4. mkmf with_config

検索結果

Enumerator#with_object(obj) -> Enumerator (81709.0)

繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。

...かった場合は、上で説明した繰り返しを実行し、
最後に obj を返す Enumerator を返します。

//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end

to_three_with_string = to_three.with_obje...

Enumerator#with_object(obj) {|(*args), memo_obj| ... } -> object (81409.0)

繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。

...かった場合は、上で説明した繰り返しを実行し、
最後に obj を返す Enumerator を返します。

//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end

to_three_with_string = to_three.with_obje...