summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2023-06-21 16:49:51 +0900
committerGitHub <noreply@github.com>2023-06-21 16:49:51 +0900
commita87bce86bb2a7581943355b41abaf41a6ad18218 (patch)
tree34686e94b2f5fb9f10d6e17a06385d98e97b0014 /object.c
parente25403d0d97b737901d137c54635df0413155ad4 (diff)
Allow setting the name of a class or module. (#7483)
Introduce `Module#set_temporary_name` for setting identifiers for otherwise anonymous modules/classes.
Notes
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'object.c')
-rw-r--r--object.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/object.c b/object.c
index 94e85ed316..823b8df2cf 100644
--- a/object.c
+++ b/object.c
@@ -4508,6 +4508,7 @@ InitVM_Object(void)
rb_define_method(rb_cModule, "included_modules", rb_mod_included_modules, 0); /* in class.c */
rb_define_method(rb_cModule, "include?", rb_mod_include_p, 1); /* in class.c */
rb_define_method(rb_cModule, "name", rb_mod_name, 0); /* in variable.c */
+ rb_define_method(rb_cModule, "set_temporary_name", rb_mod_set_temporary_name, 1); /* in variable.c */
rb_define_method(rb_cModule, "ancestors", rb_mod_ancestors, 0); /* in class.c */
rb_define_method(rb_cModule, "attr", rb_mod_attr, -1);