Ruby 1.9.2 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Enumerableモジュール > collect_concat

instance method Enumerable#collect_concat

flat_map -> Enumerator
collect_concat -> Enumerator
flat_map {| obj | block } -> Array
collect_concat {| obj | block } -> Array

Returns a new array with the concatenated results of running <em>block</em> once for every element in <i>enum</i>.

[[1,2],[3,4]].flat_map {|i| i }   #=> [1, 2, 3, 4]