From: Robert Klemme Date: 2011-10-04T16:21:02+09:00 Subject: Re: Need some help with hashes, don't know what fails On Tue, Oct 4, 2011 at 2:21 AM, Yossef Mendelssohn wrote: > On Oct 3, 3:42 am, Antonio Fernández vara > wrote: >> ## just a sample >> notifications = Hash.new >> >> notifications['1'] = { what: 'text', who: 'Antonio', when: Time.now} >> notifications['2'] = { what: 'text', who: 'Alfonso', when: Time.now} >> notifications['3'] = { what: 'text', who: 'Alberto', when: Time.now} > > If this is an accurate portrayal of your hash-of-hashes in the real > code, I suggest you consider an array-of-hashes instead. Or even an array of Structs, e.g. Item = Struct.new :what, :who, :when notifications = [ Item['text', 'Antonio', Time.now], Item['text', 'Antonio', Time.now], Item['text', 'Antonio', Time.now], ] Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/