From: Ross Bamford Date: 2006-11-21T00:50:06+09:00 Subject: Re: Create array of hash values On Mon, 20 Nov 2006 15:33:33 -0000, 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 > Assuming Contact_List (aside: why an underscored class name?) has an attr_accessor for 'attributes', you might try: a.map { |clist| clist.attributes['contact_id'] } (where 'a' is the array you show above). -- Ross Bamford - rosco@roscopeco.remove.co.uk