.find_all.with_index { |item, index| ... }
What I think is being sought is more like:
module Enumerable def find_indices each.with_index .find_all {|x,_| yield x} .map {|_,y| y} end end
What I think is being sought is more like: