aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-06-03 14:10:30 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-06-03 14:10:30 +0900
commit1b44fcf22205dd9f1c6beb5e83ab3c98374ad1e4 (patch)
treeadbd5a2375cdd430e81e2504d92ab485c713f903
parent5342fcb67fbefeea28d2c2f6820d89f6ef3caffb (diff)
downloadruby-1b44fcf22205dd9f1c6beb5e83ab3c98374ad1e4.tar.gz
[DOC] Mention the case to autoload already defined constant
-rw-r--r--load.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/load.c b/load.c
index b8d0da7fc2..2cdd64a163 100644
--- a/load.c
+++ b/load.c
@@ -1313,6 +1313,10 @@ ruby_init_ext(const char *name, void (*init)(void))
* end
* A.autoload(:B, "b")
* A::B.doit # autoloads "b"
+ *
+ * If _const_ in _mod_ is defined as autoload, the file name to be
+ * loaded is replaced with _filename_. If _const_ is defined but not
+ * as autoload, does nothing.
*/
static VALUE
@@ -1373,6 +1377,10 @@ rb_mod_autoload_p(int argc, VALUE *argv, VALUE mod)
* a symbol) is accessed.
*
* autoload(:MyModule, "/usr/local/lib/modules/my_module.rb")
+ *
+ * If _const_ is defined as autoload, the file name to be loaded is
+ * replaced with _filename_. If _const_ is defined but not as
+ * autoload, does nothing.
*/
static VALUE