From: "ako..." Date: 2005-11-23T07:07:25+09:00 Subject: what is the ruby way to do this? hello, i am still learning. in the below code @attributes is a hash table. i want to add a new value 'a' for a key represented by 'a.key'. i also want to group values with the same keys in to arrays. thanks for any help. konstantin if @attributes.has_key?(a.key) if @attributes[a.key].is_a?(Array) @attributes[a.key] << a else @attributes[a.key] = [@attributes[a.key], a] end else @attributes[a.key] = a end