From: Michal Rokos Date: 2002-01-06T21:15:56+09:00 Subject: [ruby-talk:30343] Re: OT: Re: Sorting a Hash by value of integer stored in the Hash Hello, Minero Aoki wrote: > In mail "[ruby-talk:30336] OT: Re: Sorting a Hash by value of integer stored in the Hash" >> > ary = [["x", 3], ["z", 5], ["y", 7]] >> ^^^^^^^ > Hash[ *ary.flatten ] OK, this works, but let's imagine another ex.: a = [[1,[2,3]],[4,[5,6]]] I want {1=>[2,3], 4=>[5,6]}, not {1=>2, 3=>4, 5=>6}... :-) Michal -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michal Rokos Czech Technical University, Prague E-mail: m.rokos@sh.cvut.cz Jabber: majkl@jabber.cz, ICQ: 36118339 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-