From: Ken Bloom Date: 2006-11-21T00:45:05+09:00 Subject: Re: Create array of hash values On Tue, 21 Nov 2006 00:33:33 +0900, 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 > Sorry. I should look at the code you have before I respond. You have an array full of objects. I'm not sure how to get a contact_id out of a Contact_List, but let's assume you've defined a method that gets you the contact id, called Contact_List#id Then, you would get the contact id by [#"4"}>, #"8"}>].collect do |x| x.id end -- Ken Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/