Skip to content
instance method

Module#deprecate_constant

(*::interned) -> self
mod.deprecate_constant(symbol, ...) => mod

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