aboutsummaryrefslogtreecommitdiffstats
path: root/enum.c
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-11 01:48:20 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-11 01:48:20 +0000
commitf330b7bd8751ccf87ea05309abd4b6ca1713b31e (patch)
treecabea691d75e389425dde1d8308a1d05e8ddb9d4 /enum.c
parent9ad161f7ce956743089171023fe4eed224741cbb (diff)
downloadruby-f330b7bd8751ccf87ea05309abd4b6ca1713b31e.tar.gz
* enum.c: added doc for Enumerable#zip
[fix GH-985] Patch by @yui-knk * test/ruby/test_enum.rb: added tests for Enumerable#zip [fix GH-985] Patch @yui-knk git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/enum.c b/enum.c
index c3002cb874..70267a07dd 100644
--- a/enum.c
+++ b/enum.c
@@ -2454,6 +2454,10 @@ zip_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
* [1, 2].zip(a, b) #=> [[1, 4, 7], [2, 5, 8]]
* a.zip([1, 2], [8]) #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]]
*
+ * c = []
+ * a.zip(b) { |x, y| c << x + y } #=> nil
+ * c #=> [11, 13, 15]
+ *
*/
static VALUE