summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-05 20:40:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-05 20:40:49 +0000
commitc1cc84187ffe9a30ca90522c31a555a30c73c0eb (patch)
tree30d2de6889dfb6554a29e67eabaf4778c7da3675 /enumerator.c
parentebff0059f4a45d02abb66a7f5ed2a4697136b940 (diff)
enumerator.c: [DOC] Enumerator::Lazy#force [ci skip]
added documentation of Enumerator::Lazy#force, just to clarify that it is an alias of an inherited method. [ruby-core:88872] [Bug #15079] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/enumerator.c b/enumerator.c
index 59e1633325..2c115aa740 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -1613,6 +1613,20 @@ lazy_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
+#if 0 /* for RDoc */
+/*
+ * call-seq:
+ * lazy.to_a -> array
+ * lazy.force -> array
+ *
+ * Expands +lazy+ enumerator to an array.
+ * See Enumerable#to_a.
+ */
+static VALUE lazy_to_a(VALUE self)
+{
+}
+#endif
+
static void
lazy_set_args(VALUE lazy, VALUE args)
{
@@ -2833,6 +2847,9 @@ InitVM_Enumerator(void)
rb_define_method(rb_cLazy, "chunk_while", lazy_super, -1);
rb_define_method(rb_cLazy, "uniq", lazy_uniq, 0);
+#if 0 /* for RDoc */
+ rb_define_method(rb_cLazy, "to_a", lazy_to_a, 0);
+#endif
rb_define_alias(rb_cLazy, "force", "to_a");
rb_eStopIteration = rb_define_class("StopIteration", rb_eIndexError);