From: Konrad Meyer Date: 2007-08-09T18:30:31+09:00 Subject: Re: Collect objects from an array based on one unique parameter --nextPart1342838.3hG2f52WpC Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 09 August 2007 02:24:46 am Milo Thurston wrote: > If one has an array of objects, each containing various values, what > means are there to find all the objects where one of these particular > values is unique? And only those unique values? names =3D names.uniq # or names.uniq! # I'm using the same variable name used in your # example code > I have done this using a hash to record values I've seen before (code > attached), but wondered if there might be another way, e.g. using > collect. >=20 > Attachments: > http://www.ruby-forum.com/attachment/76/modeltest.rb =2D-=20 Konrad Meyer http://konrad.sobertillnoon.com/ --nextPart1342838.3hG2f52WpC Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGut67CHB0oCiR2cwRAl+VAJ9G5muoF+gS4+kM8dQPdLwtdZNx1wCgybR3 MNkVFUaAWPQr49ERbCfAGBA= =5zwL -----END PGP SIGNATURE----- --nextPart1342838.3hG2f52WpC--