クラス変数を含むモジュールがあります
module Abc
@@variable = "huhu"
def self.get_variable
@@variable
end
class Hello
def hola
puts Abc.get_variable
end
end
end
a = Abc::Hello.new
a.hola
メソッドを使わずに@@variable中に入ることはできますか?私は何かがいいだろうという意味です。ちょっと興味があるんだけど。Helloget_variableAbc.variable