diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-25 19:07:32 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-25 19:07:32 +0900 |
| commit | b042b951ce4003f00dc33cdac1c9d422e1a21d55 (patch) | |
| tree | 634be1dfea23d384bc20af904203d68d2812a9e2 /mrbgems/mruby-enum-ext | |
| parent | 648059575d16a21684897fab4be009e1fa757e4b (diff) | |
| download | mruby-b042b951ce4003f00dc33cdac1c9d422e1a21d55.tar.gz mruby-b042b951ce4003f00dc33cdac1c9d422e1a21d55.zip | |
Enumerable#find_index to support multiple values
Diffstat (limited to 'mrbgems/mruby-enum-ext')
| -rw-r--r-- | mrbgems/mruby-enum-ext/mrblib/enum.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mrbgems/mruby-enum-ext/mrblib/enum.rb b/mrbgems/mruby-enum-ext/mrblib/enum.rb index 92c89a8f7..ead9a794a 100644 --- a/mrbgems/mruby-enum-ext/mrblib/enum.rb +++ b/mrbgems/mruby-enum-ext/mrblib/enum.rb @@ -603,13 +603,13 @@ module Enumerable idx = 0 if block - self.each do |e| - return idx if block.call(e) + self.each do |*e| + return idx if block.call(*e) idx += 1 end else - self.each do |e| - return idx if e == val + self.each do |*e| + return idx if e.__svalue == val idx += 1 end end |
