最喜欢用if判定来做些奇妙的事情了...作者: gghg1989 时间: 2010-10-26 12:08
提示: 作者被禁止或删除 内容自动屏蔽作者: 熊的选民 时间: 2010-10-28 03:18
active = 是个函数?作者: enghao_lim 时间: 2010-10-28 15:51
class A
@a = 0
def active=(n)
@a += n
end
def active
return @a * 2
end
def add(a,b)
@a += a-b
end
end
@status = A.new
@status.active = 3
if @status.active == 3
@status.add(1,2)
end