From: James Edward Gray II Date: 2005-05-15T05:29:39+09:00 Subject: Re: how to keep hash sort from YAML On May 14, 2005, at 3:26 PM, dave wrote: > > how can I cast a YAML hash data into a ruby obj without > any auto-sort feature? > --- > 2: 1 > 1: 2 > 3: 3 > > => {1=> 2, 2=>1, 3=>3} # no, thanks > => {2=> 1, 1=>2, 3=>3} # yes! Hashes are unordered by definition. You have no control over how Ruby stores and returns the pairs. If you need an ordered data structure, use an Array. Hope that helps. James Edward Gray II