After many years, Ruby 2.7 ships with Enumerable#filter_map()
to make this simpler:
stuff.filter_map.with_index { |elem, index| index if elem == '' }
After many years, Ruby 2.7 ships with Enumerable#filter_map()
to make this simpler:
stuff.filter_map.with_index { |elem, index| index if elem == '' }