From: tokmak tokmak Date: 2005-08-31T19:44:16+09:00 Subject: Re: Win32ole object collection mapping to array ? ------=_Part_1030_8826167.1125485053650 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline You can try this (apologies if i misunderstood you problem): oleitems.map{|o| o.Name}.sort This makes an array of Name values, then sorts it. I couldn't understand if= =20 you want values as an array or hash. On 8/25/05, Peter Fitzgibbons wrote: >=20 > Hello all, >=20 > I have a win32ole object collection that I want to map, then sort, to an > array? >=20 > Each item has #Name property. I'm thinking of making an arry of hashes > a'la : >=20 > > items =3D [] > > oleItems.each {|o| items << {o.Name =3D> o} } > > items > [{"0172"=3D>#}, {"0171"=3D>#}] >=20 > But then, how do I sort the array of hashes ? >=20 > Is there a better approach ? >=20 > Peter J. Fitzgibbons > Applications Manager > Lakewood Homes - "The American Dream Builder"(r) > Peter.Fitzgibbons@Lakewoodhomes.net > (847) 884-8800 >=20 >=20 >=20 > ------=_Part_1030_8826167.1125485053650--