ruby基础

06 Apr 2013, by

return,break,next区别

异常处理

begin
  p "正常情况"
rescue e
  p "异常情况"
  raise "抛出异常"
ensure
  p "出错继续执行"
end

最常用的迭代器:

迭代器简介

迭代器详解:

Alt text