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 <ara.t.howard / gmail.com>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