Hello,
I have an array :-
a = [1, 2, 3, 4, 5]
I have 13 objects with sequence. I want to assign a’s value to these objects which will be repeated.
so after every 5 objects, these a’s value will be assigned & will be repeated.
a.each.with_index do |col, col_index|
Some code here.
// How should I again assign the col_index to ‘0’ again, so that I can repeat those values & save values to the objects?
end
I am able to assign first 5 objects.
Thanks,
Avinash