0
class X
end
class A
def get_it
puts @the_variable
end
end
class B
def init_it
@the_variable = X.new
a = A.new
end
end
访问呼叫者变量在上面的代码我想要的一类方法来访问X在B实例化的实例红宝石:从声明OBJ实例