From: David Alan Black Date: 2004-04-24T21:54:06+09:00 Subject: Re: Array to Hash Hi -- "Pe�a, Botp" writes: > conversion fr hash to array is fine. > > >> h > => {"x"=>1, "y"=>3} > >> a = h.to_a > => [["x", 1], ["y", 3]] > > no brainer there for a nuby like me :-) I think there's a time limit on describing oneself as a nuby :-) > but... > > conversion fr array to hash... is quite a journey... [...] > Finally, I got it (dug the archives).. > > >> h2 = Hash[*a] > => {["x", 1]=>["y", 3]} Dig the archives a little more :-) There's been a lot of discussion of this in the past, including a rejected RCR (http://www.rcrchive.net/rgarchive/rejected.html#rcr12, posted under 'dave' due to some glitch but actually submitted by me). I called it "hashify", but as you'll see from the many ruby-talk references it's really the to_h[ash] idea. David -- David A. Black dblack@wobblini.net