Hello!
Consider the following code:
def create_class(class_name, superclass, &block)
klass = Class.new superclass, &block
Object.const_set class_name, klass
end
After I do:
create_class('User', ActiveRecord::Base)
the following is ok:
Object.send(:remove_const, :User)
but this:
Object.remove_const :User
results in this:
NoMethodError: private method `remove_const' called for Object:Class
? Does not make sense for me... can 'send' override Ruby's access checks? Please help!