Switch inject to each_with_object