StopIteration

StopIteration has not been discovered yet

Ruby's StopIteration class

Raised to stop the iteration, in particular by Enumerator#next. It is rescued by Kernel#loop.

loop do
  puts "Hello"
  raise StopIteration
  puts "World"
end
puts "Done!"

produces:

Hello
Done!

Superclass

IndexError

Methods

  • result

Enemies

Honeybadger