From: Robert Klemme Date: 2005-11-04T22:22:09+09:00 Subject: Re: instantiating one of each object type Trans wrote: > You gogin to have trouble instatiating without know what it is. Try > #allocate: > > objs = [] > ObjectSpace.each_object(Class) do |c| > objs << c.allocate > end > p objs > There should at least be a rescue clause as not every class supports #allocate: >> ObjectSpace.each_object(Class) {|cl| cl.allocate} TypeError: allocator undefined for Binding from (irb):14:in `allocate' from (irb):14 from (irb):14 Kind regards robert