From: OZAWA Sakuro Date: 2000-03-18T01:24:37+09:00 Subject: [ruby-talk:01978] Re: Iterating over all instances of a class In article , David Douthitt writes: > I just KNOW this is related to "collection" somehow, or that there is a way to do this. >However, the way I do it now is to create an array of instances, >but this creates some unwieldy *.find{ |i| .... } sequences and >worse. Can't I do a find over instances of a class? oll_instances_of_Foo = [] OblectSpace.each_object(Foo) do |obj| all_instances_of_Foo << obj end -- OZAWA -Crouton- Sakuro PGP指紋: C98F 74E0 AEEB 4578 1DFC F650 3BE0 9627 11FC C9F5