From b042b951ce4003f00dc33cdac1c9d422e1a21d55 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 25 Mar 2014 19:07:32 +0900 Subject: Enumerable#find_index to support multiple values --- mrbgems/mruby-enum-ext/mrblib/enum.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mrbgems/mruby-enum-ext/mrblib/enum.rb') 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 -- cgit v1.2.3