module Module::DeprecatePublicConstant
Public Instance Methods
const_missing(const)
click to toggle source
Handle access to constants where deprecate_public_constant
has been called for the constant, printing the warning and then using const_get
to access the constant.
Calls superclass method
# File lib/deprecate_public.rb 46 def const_missing(const) 47 check_meth = "_deprecated_public_constant_message_#{const}" 48 if const_defined?(const, true) && respond_to?(check_meth, true) && (msg = send(check_meth)) 49 Kernel.warn(msg, :uplevel => 1) 50 const_get(const, true) 51 else 52 super 53 end 54 end