摘要:[root@companyruby]#vimruby.rb#!/usr/bin/envrubyclassGreeterattr_accessor:namedefinitialize(name="HelloWorld")@name=name;enddefsay_hi(age="36")puts"Hi#{@name}#{age}!"enddefsay_byeputs"Bye#{@name},comebacksoon"endendg=Greeter.new("Pat")g.say_hi(36)g.sa 阅读全文
posted @ 2012-11-24 11:55 Linux、Mongo、Php、Shell、Python、C 阅读 (75) 评论 (0) 编辑