From: Ken Kunz Date: 2005-11-23T07:42:24+09:00 Subject: Re: what is the ruby way to do this? Konstantin, When you have a single attribute associated with a key, is it acceptable to have it in a one-element array? If so, you could do something like: @attributes = {} .... @attributes[a.key] ||= [] @attributes[a.key] << a Or, if you don't mind having empty keys return an empty array instead of nil, you could do: @attributes = Hash.new([]) .... @attributes[a.key] << a Cheers, Ken