From: Thufir Date: 2008-02-16T07:30:05+09:00 Subject: Re: Change a data structure On Fri, 25 Jan 2008 00:24:57 +0900, yermej wrote: > This might help, though some would say it's better just to avoid inject > entirely: > > timing_given.each do |test_type, test_data| > timing_given[test_type] = > test_data.inject(Hash.new {|h, k| h[k] = []}) do |new_hash, > old_hash| > old_hash.each do |data_field, data_value| > new_hash[data_field] << data_value > end > new_hash > end > end Why would this be preferable to using a db for storing data? I don't understand the prevalence of Hash. -Thufir