From: Gregory Seidman Date: 2007-11-18T06:07:26+09:00 Subject: Re: Hash -> Struct On Sun, Nov 18, 2007 at 01:47:53AM +0900, Trans wrote: > Given that a hash is not ordered, is this reliable? > > h = { :a=>1, :b=>2 } > Struct.new(*h.keys).new(*h.values) > => # a=1, b=2> It should work, but it causes me discomfort, too. I prefer this: k,v = h.to_a.transpose Struct.new(*k).new(*v) > T. --Greg