I\'m trying to understand exceptions in Ruby but I\'m a little confused. The tutorial I\'m using says that if an exception occurs that does not match any of the exceptions iden
The else is for when the block completes without an exception thrown. The ensure is run whether the block completes successfully or not. Example:
else
ensure
begin puts "Hello, world!" rescue puts "rescue" else puts "else" ensure puts "ensure" end
This will print Hello, world!, then else, then ensure.
Hello, world!