summaryrefslogtreecommitdiff
path: root/complex.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-24 08:02:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-24 08:02:17 +0000
commit9aac312f77ff9cbfe357689d4b3832b9b344263b (patch)
tree51e2f50dc246a864f514eedf99f0eeaad33ec437 /complex.c
parent922048adee910c0e57ca3f7a897670a3d2186fb8 (diff)
* complex.c (Init_Complex), rational.c (Init_Rational): ID_ALLOCATOR
differs from :allocate, and invisible in ruby level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/complex.c b/complex.c
index 23940dc270..dba87d4984 100644
--- a/complex.c
+++ b/complex.c
@@ -1371,17 +1371,10 @@ Init_Complex(void)
rb_cComplex = rb_define_class(COMPLEX_NAME, rb_cNumeric);
rb_define_alloc_func(rb_cComplex, nucomp_s_alloc);
- rb_funcall(rb_cComplex, rb_intern("private_class_method"), 1,
- ID2SYM(rb_intern("allocate")));
#if 0
- rb_define_singleton_method(rb_cComplex, "new!", nucomp_s_new_bang, -1);
- rb_funcall(rb_cComplex, rb_intern("private_class_method"), 1,
- ID2SYM(rb_intern("new!")));
-
- rb_define_singleton_method(rb_cComplex, "new", nucomp_s_new, -1);
- rb_funcall(rb_cComplex, rb_intern("private_class_method"), 1,
- ID2SYM(rb_intern("new")));
+ rb_define_private_method(CLASS_OF(rb_cComplex), "new!", nucomp_s_new_bang, -1);
+ rb_define_private_method(CLASS_OF(rb_cComplex), "new", nucomp_s_new, -1);
#else
rb_undef_method(CLASS_OF(rb_cComplex), "new");
#endif
@@ -1472,9 +1465,7 @@ Init_Complex(void)
rb_define_method(rb_cString, "to_c", string_to_c, 0);
- rb_define_singleton_method(rb_cComplex, "convert", nucomp_s_convert, -1);
- rb_funcall(rb_cComplex, rb_intern("private_class_method"), 1,
- ID2SYM(rb_intern("convert")));
+ rb_define_private_method(CLASS_OF(rb_cComplex), "convert", nucomp_s_convert, -1);
/* --- */