data = ['0', '1', '2', '3', '4', '5'] order = [3, 1, 2, 0, 4, 5] data.values_at *order #or something like this order.map{|x| data[x]}