From: Roger Pack Date: 2011-02-13T10:38:37+09:00 Subject: Re: Is there anything like Array#Index that takes a block? For followers, I believe the acceptable backport for 1.8.6 is: if RUBY_VERSION < '1.8.7' class Array alias original_index index def index *args if args.length > 0 return original_index(*args) else pos = nil each_with_index do |element, i| if yield(element) return i end end return nil end end end end -- Posted via http://www.ruby-forum.com/.