summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-03-05 12:47:00 -0800
committerJeremy Evans <code@jeremyevans.net>2021-03-06 13:56:16 -0800
commit68d028578a5975fe6c44d29c502615ff9af72927 (patch)
tree151a19b8ddbf97460301a4b970e8897f689e252a /enumerator.c
parente1d16a9e560a615e122e457325bcfb7c47228ed6 (diff)
Undef Enumerator::Chain#{feed,next,next_values,peek,peek_values}
Previously these methods were defined but raised TypeError, which seems worse.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3811
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/enumerator.c b/enumerator.c
index 45620f352a..a43434dd94 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -4200,6 +4200,11 @@ InitVM_Enumerator(void)
rb_define_method(rb_cEnumChain, "size", enum_chain_size, 0);
rb_define_method(rb_cEnumChain, "rewind", enum_chain_rewind, 0);
rb_define_method(rb_cEnumChain, "inspect", enum_chain_inspect, 0);
+ rb_undef_method(rb_cEnumChain, "feed");
+ rb_undef_method(rb_cEnumChain, "next");
+ rb_undef_method(rb_cEnumChain, "next_values");
+ rb_undef_method(rb_cEnumChain, "peek");
+ rb_undef_method(rb_cEnumChain, "peek_values");
/* ArithmeticSequence */
rb_cArithSeq = rb_define_class_under(rb_cEnumerator, "ArithmeticSequence", rb_cEnumerator);