Ruby Loop masing -masing dengan indeks

X.each_with_index do |item, index|
  puts "current_index: #{index}"
end
Clumsy Capybara