我现在这样用
class A
class << self
attr_accessor :username, :password
def fun
# username
end
end
我想在外部配置 username,和 password
比如在 initializer 目录里面放一个文件,里面写
A.username = 'xxxx' A.password = 'xxxx'
我在 A.fun 里面取不到设置的值
我想这样用,应该如何实现 A 呢?