From: Peter Szinek Date: 2006-11-21T00:39:12+09:00 Subject: Re: Create array of hash values 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? Try this: result = x.inject([]) {|a,h| a << h.values[0]; a} (x is the array of hashes) Cheers, Peter __ http://www.rubyrailways.com