summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/bigdecimal.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-10-08 15:23:46 -0700
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-06 01:15:45 +0900
commitceb9d516c6d17b0619cf53dfba7cb7b29fe073e4 (patch)
treed888fc8896a20b212eb7bd96cf3962db488baafe /ext/bigdecimal/bigdecimal.c
parentd69510b6cda4024237de8f5766d85397abd5e434 (diff)
[ruby/bigdecimal] Undef BigDecimal#initialize_copy
Both BigDecimal#clone and BigDecimal#dup return self, there is no reason to have initialize_copy exposed as a Ruby method. The same is true for initialize_clone and initialize_dup. https://github.com/ruby/bigdecimal/commit/aaf237fa9e
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3295
Diffstat (limited to 'ext/bigdecimal/bigdecimal.c')
-rw-r--r--ext/bigdecimal/bigdecimal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index c442335a0a..23851eea58 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -3451,7 +3451,9 @@ Init_bigdecimal(void)
/* instance methods */
- rb_define_method(rb_cBigDecimal, "initialize_copy", BigDecimal_initialize_copy, 1);
+ rb_undef_method(rb_cBigDecimal, "initialize_copy");
+ rb_undef_method(rb_cBigDecimal, "initialize_clone");
+ rb_undef_method(rb_cBigDecimal, "initialize_dup");
rb_define_method(rb_cBigDecimal, "precs", BigDecimal_prec, 0);
rb_define_method(rb_cBigDecimal, "add", BigDecimal_add2, 2);