From: Sam McCall Date: 2004-09-09T13:10:05+09:00 Subject: Re: [RCR] Unified type conversion framework Florian Gross wrote: > Paul Brannan wrote: > >> I think you mean Hash[*anArray]. IMO, It's not totally unintuitive, but >> it's not consistent with other conversions. > > > Actually converting an assoc array to a Hash is done via > Hash[*array.flatten]. I think that that is pretty low level. I'd prefer > something like Hash.from_assoc() At work we have Array#to_h in a library, it's really useful for things like: db.select_all(...).map {|foo,bar| [foo,bar]}.to_h Sam