diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-24 08:02:17 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-24 08:02:17 +0000 |
commit | 3c6c7ac4eb2e0c85c0c2d13ed4e65b8e277e15b6 (patch) | |
tree | 51e2f50dc246a864f514eedf99f0eeaad33ec437 /rational.c | |
parent | bfa3763a21d05ff854ce02212f1ed9ab89990d52 (diff) | |
download | ruby-3c6c7ac4eb2e0c85c0c2d13ed4e65b8e277e15b6.tar.gz ruby-3c6c7ac4eb2e0c85c0c2d13ed4e65b8e277e15b6.tar.xz ruby-3c6c7ac4eb2e0c85c0c2d13ed4e65b8e277e15b6.zip |
* complex.c (Init_Complex), rational.c (Init_Rational): ID_ALLOCATOR
differs from :allocate, and invisible in ruby level.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/rational.c b/rational.c index 8e77c8aa0..ad235498b 100644 --- a/rational.c +++ b/rational.c @@ -1488,17 +1488,10 @@ Init_Rational(void) rb_cRational = rb_define_class(RATIONAL_NAME, rb_cNumeric); rb_define_alloc_func(rb_cRational, nurat_s_alloc); - rb_funcall(rb_cRational, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("allocate"))); #if 0 - rb_define_singleton_method(rb_cRational, "new!", nurat_s_new_bang, -1); - rb_funcall(rb_cRational, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("new!"))); - - rb_define_singleton_method(rb_cRational, "new", nurat_s_new, -1); - rb_funcall(rb_cRational, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("new"))); + rb_define_private_method(CLASS_OF(rb_cRational), "new!", nurat_s_new_bang, -1); + rb_define_private_method(CLASS_OF(rb_cRational), "new", nurat_s_new, -1); #else rb_undef_method(CLASS_OF(rb_cRational), "new"); #endif @@ -1574,9 +1567,7 @@ Init_Rational(void) rb_define_method(rb_cString, "to_r", string_to_r, 0); - rb_define_singleton_method(rb_cRational, "convert", nurat_s_convert, -1); - rb_funcall(rb_cRational, rb_intern("private_class_method"), 1, - ID2SYM(rb_intern("convert"))); + rb_define_private_method(CLASS_OF(rb_cRational), "convert", nurat_s_convert, -1); } /* |