Welcome to Rainy's blog!

Ruby异常与线程

上一篇 / 下一篇  2008-02-03 14:22:37 / 个人分类:Ruby

Java中的try…catch…finally…throw相对应, Ruby中用begin/end …rescue…ensure … raise来处理异常,retry可以用在rescue中。可以只用rescue或是ensure,两者都使用时,rescue必须在ensure前。

 

attr_writer :motherland相当于

def motherland=(value)

return @motherland =value

end

attr_ reader :motherland相当于

def motherland

return @motherland

end

attr_accessor :motherland相当于

attr_reader:motherland

attr_writer:motherland


TAG: Ruby

 

评分:0

我来说两句

我的栏目

日历

« 2024-04-28  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 23615
  • 日志数: 33
  • 图片数: 5
  • 书签数: 2
  • 建立时间: 2006-12-05
  • 更新时间: 2008-03-22

RSS订阅

Open Toolbar