tags:

views:

234

answers:

2

I have a class defined using theClass.class_eval and Object.const_set(className, theClass). Is there any way to remove the definition of this class? During testing I need to load different versions of the same class.

+4  A: 

Object.send(:remove_const, className) did the trick.

LK
A: 

I see that doing Object.send(:remove_const, className) prevent to reload the same class..

how to reload?

tapioco123