抓住
与许多其他编程语言不同,throw 和 catch 关键字与 Ruby 中的异常处理无关。
在 Ruby 中,throw 和 catch 在其他语言中有点像标签。它们用于更改控制流,但与异常之类的错误概念无关。
catch(:out) do
  catch(:nested) do
    puts "nested"
  end
  puts "before"
  throw :out
  puts "will not be executed"
end
puts "after"
# prints "nested", "before", "after"