summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-07 12:42:48 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-07 12:42:48 +0000
commit19768b6cacb1319f34944a0dc5e0bbe099d2d18e (patch)
treedff9cb9190b86c36c642dd25c18f8a8bd777fa23 /vm_method.c
parent4722c20661093f5071701941bc2f7b519f2a7283 (diff)
* vm_method.c (Init_eval_method): main.public and main.private
should be private. * proc.c (Init_Proc): main.define_method should be private. * test/ruby/test_module.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vm_method.c b/vm_method.c
index f219d7cb43..cfeb012bde 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1610,8 +1610,10 @@ Init_eval_method(void)
rb_define_method(rb_cModule, "public_class_method", rb_mod_public_method, -1);
rb_define_method(rb_cModule, "private_class_method", rb_mod_private_method, -1);
- rb_define_singleton_method(rb_vm_top_self(), "public", top_public, -1);
- rb_define_singleton_method(rb_vm_top_self(), "private", top_private, -1);
+ rb_define_private_method(rb_singleton_class(rb_vm_top_self()),
+ "public", top_public, -1);
+ rb_define_private_method(rb_singleton_class(rb_vm_top_self()),
+ "private", top_private, -1);
object_id = rb_intern("object_id");
added = rb_intern("method_added");