例如:
class MyClass
@@var1 = '123456'
def self.var1
@@var1
end
class << self
attr_accessor :var2
def self.initialize
self.var2 = 7890
end
end
end
p MyClass.var1 # "123456"
p MyClass.var2 # nil
有没有办法初始化var2?