From: Massimiliano Mirra Date: 2002-01-07T08:37:20+09:00 Subject: [ruby-talk:30382] Re: OT: Re: Sorting a Hash by value of integer stored in the Hash On Mon, Jan 07, 2002 at 01:56:14AM +0900, Michal Rokos wrote: > Once again: > h = {1=>[2,3],4=>[5,6]} > a = h.to_a # gives [1,[2,3]],[4,[5,6]]] > a.to_h # should give h! - and this isn't now Of course, you could just do: class Array def to_h Hash[*self] end end ...and don't forget to add it to your xarray.rb. ;-) Massimiliano