クラスの1つがsthに似ている宝石を持っています:
class Test
TESTING = {
:sth1 => 'foo',
:sth2 => 'bar'
}
# p Test.new.show
# should print 'cat'
def show
p TESTING[:sth3]
end
end
他のファイルで拡張しました
# in other file
class Test
TESTING = {
:sth3 => 'cat'
}
end
しかし、コードの最初の部分が立っているので、最初のファイルで :sth3 を使用する必要があります。事前にthx。