remove_const(p1)
private
Removes the definition of the given constant, returning that constant’s
previous value. If that constant referred to a module, this will not
change that module’s name and can lead to
confusion.
Show source
VALUE
rb_mod_remove_const(VALUE mod, VALUE name)
{
const ID id = rb_to_id(name);
if (!rb_is_const_id(id)) {
rb_name_error(id, "`%s' is not allowed as a constant name", rb_id2name(id));
}
return rb_const_remove(mod, id);
}