From: nobu.nokada@... Date: 2004-04-24T13:36:48+09:00 Subject: Re: Array to Hash Hi, At Sat, 24 Apr 2004 13:05:20 +0900, Pe�a, Botp wrote in [ruby-talk:98203]: > I would rather prefer: > > >> h2 = a.to_hash # or a.to_h > {"x"=>1, "y"=>3} module Enumerable def to_h inject({}) {|h, (k, v)| h[k] = v; h} end end -- Nobu Nakada