Say I have an array with n elements. I want to take the first ten elements and do something with them, and then the next ten and so on until the array is executed.
What is the right way for Ruby to do this? (With a c-language background, I could write some for and loop within the loop, up to ten, do things and set my accounting variable to zero and continue processing the main array.)
source
share