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 = id_for_var(mod, name, a, constant);
if (!id) {
rb_name_err_raise("constant %2$s::%1$s not defined",
mod, name);
}
return rb_const_remove(mod, id);
}