From: Michel Casabianca Date: 2006-11-24T00:36:02+09:00 Subject: Re: Create array of hash values ------=_Part_10789_30557954.1164296158062 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline c_ids = my_hash.values.collect{|value| value.attributes['contact_id']} 2006/11/23, atoz.cd@googlemail.com : > > Personally I'd do: > > c_ids=[] > > for l in @attributes.values > c_ids << l > end > > David Lelong wrote: > > Hi, > > > > I have a hash that contains the following keys/values: > > > > [#"4"}>, > > #"8"}>] > > > > I want to create an array containing the contact_id values. What's an > > easy way to do this? > > > > Thanks, > > > > David > > > > -- > > Posted via http://www.ruby-forum.com/. > > > -- Michel Casabianca ------=_Part_10789_30557954.1164296158062--