First page Back Continue Last page Overview Text


Another one of the arduous restrictions ruby places on you is that it doesn't allow you to dup singleton classes.

Evilr is your friend here, offering a dup_singleton_class method that gives you a duplicate of the singleton class.

The stupid thing about this is you can get a dup of a singleton class in ruby easily just by cloning the object and getting the singleton class of that clone, so the restriction on duping singleton classes makes little sense.