src code

instance method Array#flatten

Array#flatten() → Array

Returns a "flat" (one-dimensional) version of the array.

Nested arrays are recursively injected "inline." This can prove very useful when handling the results of a recursive collection algorithm, for instance.