Paul Brannan wrote:
> How can I get class that the singleton class is a singleton class of?

In general, an eigenclass (or singleton class) can be an eigenclass of 
anything, and not only of a class. It can be like this: 
class<<"asd";self;end.

>   irb(main):013:0> ObjectSpace.each_object(Class) { |c| break c if 
> c.singleton_class == sc }
>   => Foo

Why complicate?

a=anything
ec=class<<a;self;end
a_=nil
ObjectSpace.each_object(ec){|aa| a_=aa}
a.equal?(a_) #=> true

The object space will call the block only once.

TPR.
-- 
Posted via http://www.ruby-forum.com/.