Skip to content
Permalink
Browse files

Merge pull request #582 from kostya/find_index

enumerable#find_index
  • Loading branch information
alex committed Apr 9, 2013
2 parents 860ba37 + 3e07903 commit f97e8ca7e6868ed62b25722f6d5fcec4ca6236c1
Showing with 8 additions and 8 deletions.
  1. +8 −0 lib-topaz/enumerable.rb
  2. +0 −8 spec/tags/core/enumerable/find_index_tags.txt
@@ -264,4 +264,12 @@ def group_by(&block)
end
h
end

def find_index(obj = nil, &block)
return self.enum_for(:find_index) if !obj && !block
each_with_index do |e, i|
return i if obj ? (e == obj) : block.call(e)
end
nil
end
end

This file was deleted.

0 comments on commit f97e8ca

Please sign in to comment.
You can’t perform that action at this time.