how to create a new object as soon as one object is done execution in ruby for loop code example Example: ruby for loop for element in array do element.do_stuff end