retry
can be used inside a rescue block, to jump back into the begin block after the condition that caused the exception has been remedied. Inside a block it has the effect of jumping to the beginning of the yielding method. So inside each this means that retry will jump to the beginning of the loop.
return
will return from the method it's inside of - in this case from a_method
.
break
will return from the yielding method - in this case from each
(which would be different from returning from a_method
if something happened between the end of the each-block and the end of a_method
).
next
will return from the block and thus jump to the next item in things
.
redo
will jump to the beginning of the block and thus repeat the current iteration.