From: Brian Takita Date: 2005-08-26T04:04:47+09:00 Subject: Re: Win32ole object collection mapping to array ? ------=_Part_6019_16678445.1124996682502 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Try this... > items =3D [] > oleItems.each {|o| items << {o.Name =3D> o} } > items.sort {|x, y| x.Name <=3D> y.Name} 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_6019_16678445.1124996682502--