From: Tony Arcieri Date: 2010-10-13T03:10:31+09:00 Subject: Re: [ANN] map-1.3.0 --001485f1ebee5a50bc04926f6484 Content-Type: text/plain; charset=ISO-8859-1 That's a cool idea I may have to steal for Reia :) HashWithIndifferentAccess is just so... meh :/ On Mon, Oct 11, 2010 at 8:48 PM, ara.t.howard wrote: > NAME > map.rb > > SYNOPSIS > the ruby container you've always wanted: a string/symbol indifferent > ordered > hash that works in all rubies > > INSTALL > gem install map > > URI > http://github.com/ahoward/map > > DESCRIPTION > m = Map[:k, :v, :key, :val] > m = Map(:k, :v, :key, :val) > > m = Map[[:k, :v], [:key, :val]] > m = Map[{:k => :v, :key => :val}] > > > m = Map.new > m[:a] = :b > m[:b] = :b > m[:c] = :c > > p m.keys #=> [:a, :b, :c] ### always ordered! > > p m[:a] #=> :a > p m["a"] #=> :a > > m.update(:k2 => :v2) > m.update(:k2, :v2) > > > m.update :nested => {:hashes => {:are => :converted}} > > USAGE > test/map_test.rb > > > > enjoy. > > -- > -a > > -- Tony Arcieri Medioh! A Kudelski Brand --001485f1ebee5a50bc04926f6484--