Exiting Ruby block

What return, break and next means for blocks

  • Use return to return from a method.
  • Use break to quit from a block and from the method that yielded to the block.
  • Use next to skip the rest of the current iteration.

Using return in a ruby block

Written on May 27, 2019, Last update on May 26, 2019
ruby block