module A
end
class D
mix A
end
c1 = D.new
这是我的输出:
archie@local$ruby mixins-traits.rb
mixins-traits.rb:4:in `<class:D>': undefined method `mix' for D:Class (NoMethodError)
from mixins-traits.rb:3:in `<main>'
module A
end
class D
mix A
end
c1 = D.new
这是我的输出:
archie@local$ruby mixins-traits.rb
mixins-traits.rb:4:in `<class:D>': undefined method `mix' for D:Class (NoMethodError)
from mixins-traits.rb:3:in `<main>'