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
commit54a8318ecd1fe160d7061bf5b59d7708148dceee (patch)
treecabea691d75e389425dde1d8308a1d05e8ddb9d4 /enum.c
parent6114b0a4f9f8f116be70728b6a976aaf1a472da0 (diff)
downloadruby-54a8318ecd1fe160d7061bf5b59d7708148dceee.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