2011-8-15 9:45:43 阅读17 评论0 152011/08 Aug15
puts "a string".index("string") #返回字符串在对象字符串中的位置
puts -250.class #返回对象属于的类名
puts -250.abs #求绝对值
class MyClass
#定义类方法
def self.method1
puts "method1";
end
#定义类方法
def MyClass.method2
puts "method2";
end
#实例方法
def method3
2011-3-25 23:21:35 阅读152 评论0 252011/03 Mar25
2011-3-25 23:20:58 阅读281 评论0 252011/03 Mar25
2011-3-25 23:19:43 阅读437 评论0 252011/03 Mar25
2011-3-24 13:02:36 阅读82 评论0 242011/03 Mar24
版本: 360硬件大师 2.76.11.103
主页: http://www.ludashi.com
操作系统: Windows XP 专业版 ( 32位 / SP3 / DirectX 9.0c )
--------[ 概览 ]----------------------------------------------------------------------------------
电脑: