Sha256: 75d97647d96baff441595fdc50e1be58479c20e00695d9ad195c8f630afc79b2

Contents?: true

Size: 496 Bytes

Versions: 25

Compression:

Stored size: 496 Bytes

Contents

# Extend Array to provide following features:
# - creates SuperHash for hashes
# - creates SuperArray for arrays
# ------------------------------- #
class CityGrid
  module Abstraction
    class SuperArray < Array
      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
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
citygrid_api-0.0.28 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.27 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.26 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.25 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.24 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.23 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.22 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.21 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.20 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.19 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.18 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.17 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.16 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.15 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.14 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.13 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.12 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.11 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.10 lib/citygrid/abstraction/super_array.rb
citygrid_api-0.0.9 lib/citygrid/abstraction/super_array.rb