instance method
Module#deprecate_constant
(*::interned) -> self
mod.deprecate_constant(symbol, ...) => mod
object.c
View on GitHub ↗
VALUE
rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj)
{
set_const_visibility(obj, argc, argv, CONST_DEPRECATED, CONST_DEPRECATED);
return obj;
}
Makes a list of existing constants deprecated. Attempt to refer to them will produce a warning.
Example
module HTTP NotFound = Exception.new NOT_FOUND = NotFound # previous version of the library used this name deprecate_constant :NOT_FOUND end HTTP::NOT_FOUND # warning: constant HTTP::NOT_FOUND is deprecated
See also
#define_method
#extended
#const_source_location
#extend_object
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0