From: Minero Aoki Date: 2002-01-06T20:19:35+09:00 Subject: [ruby-talk:30341] Re: OT: Re: Sorting a Hash by value of integer stored in the Hash Hi, In mail "[ruby-talk:30336] OT: Re: Sorting a Hash by value of integer stored in the Hash" Michal Rokos wrote: > > ary = [["x", 3], ["z", 5], ["y", 7]] > ^^^^^^^ > Is there any "automatic" way to create hash from ary (above). I > didn't find any. (I know hash = Hash[[1,2,3,4]], but I doesn't > work for this) Try this: Hash[ *ary.flatten ] -- Minero Aoki