Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/willb-mazegen/mazerenderer.rb

Overview

mazerenderer.rb is licensed under the Apache Software License, version 2.0 and Copyright © 2010 William Benton (willbenton.com)

Instance Method Summary collapse

Instance Method Details

#flatten_onceObject



5
6
7
8
9
# File 'lib/willb-mazegen/mazerenderer.rb', line 5

def flatten_once
  self.inject([]) do |acc, val|
    val.is_a?(Array) ? acc.concat(val) : acc << val
  end
end