End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Module#remove_method
remove_method(symbol) → self
remove_method(string) → self
vm_method.c
View on GitHub ↗
static VALUE
rb_mod_remove_method(int argc, VALUE *argv, VALUE mod)
{
int i;
for (i = 0; i < argc; i++) {
VALUE v = argv[i];
ID id = rb_check_id(&v);
if (!id) {
rb_name_err_raise("method `%1$s' not defined in %2$s",
mod, v);
}
remove_method(mod, id);
}
return mod;
}
Removes the method identified by symbol from the current class. For an example, see Module#undef_method. String arguments are converted to symbols.
See also
#remove_const
#ruby2_keywords
#remove_class_variable
#singleton_class?
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1