aboutsummaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
authorzverok <zverok.offline@gmail.com>2019-12-21 23:05:45 +0200
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-22 23:17:39 +0900
commitd339de9d1a11923cd6d435d995ee479d08791720 (patch)
tree6c466f8a6b32b04f02495bb386a80b86cba7339f /variable.c
parent5a0102cb615f27f2daef8af6d9ae996926b2d167 (diff)
downloadruby-d339de9d1a11923cd6d435d995ee479d08791720.tar.gz
Enhance docs for Module#deprecate_constant
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/variable.c b/variable.c
index 4d5c9a6f54..42c4cb7cd4 100644
--- a/variable.c
+++ b/variable.c
@@ -2992,7 +2992,19 @@ rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj)
* call-seq:
* mod.deprecate_constant(symbol, ...) => mod
*
- * Makes a list of existing constants deprecated.
+ * Makes a list of existing constants deprecated. Attempt
+ * to refer to them will produce a warning.
+ *
+ * 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
+ *
*/
VALUE