summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-enumerator/mrblib
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-03-30 14:49:34 +0900
committerGitHub <[email protected]>2017-03-30 14:49:34 +0900
commit898077a2c28def75b7894cea03f20bb8796b9d27 (patch)
tree35ddd2f3f8076891546bd20fc502f82b985e824e /mrbgems/mruby-enumerator/mrblib
parent905f46a129de65098b3130789bb9c412201f4cb4 (diff)
parentd93a5c1a8417949769714be40aaf62121059da96 (diff)
downloadmruby-898077a2c28def75b7894cea03f20bb8796b9d27.tar.gz
mruby-898077a2c28def75b7894cea03f20bb8796b9d27.zip
Merge pull request #3566 from okkez/fix-enumerator-each-with-index
Fix Enumerator#each_with_index with block
Diffstat (limited to 'mrbgems/mruby-enumerator/mrblib')
-rw-r--r--mrbgems/mruby-enumerator/mrblib/enumerator.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-enumerator/mrblib/enumerator.rb b/mrbgems/mruby-enumerator/mrblib/enumerator.rb
index 89b66cd45..c7b78be5c 100644
--- a/mrbgems/mruby-enumerator/mrblib/enumerator.rb
+++ b/mrbgems/mruby-enumerator/mrblib/enumerator.rb
@@ -177,8 +177,8 @@ class Enumerator
#
# If no block is given, a new Enumerator is returned that includes the index.
#
- def each_with_index
- with_index
+ def each_with_index(&block)
+ with_index(0, &block)
end
##