Class: CityGrid::Abstraction::SuperArray

Inherits:
Array
  • Object
show all
Defined in:
lib/citygrid/abstraction/super_array.rb

Direct Known Subclasses

Collection

Class Method Summary collapse

Class Method Details

.new(objs) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/citygrid/abstraction/super_array.rb', line 8

def self.new objs
  array = self.[] *objs
  array.map! do |obj|
    if obj.class == Hash
      SuperHash.new obj
    elsif obj.class == Array
      new obj
    else
      obj
    end
  end
end