以下のクラスがモジュールをインクルードするプログラムを
書いたら
NomethodError
がでました。
なぜでしょうか?
どなたか教えていただけないでしょうか?
`
module SampleModule
def self.sample_method; 'sample test!!'; end
end
class SampleClass
include SampleModule
end
puts(SampleClass.sample_method)
`
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。