class Array

Public Instance Methods

flatten(depth = -1) click to toggle source
# File lib/sfl.rb, line 202
def flatten(depth = -1)
  if depth < 0
    orig_flatten
  elsif depth == 0
    self
  else
    inject([]) {|m, i|
      Array === i ? m + i : m << i
    }.flatten(depth - 1)
  end
end
Also aliased as: orig_flatten
orig_flatten(depth = -1)
Alias for: flatten