4
class Foo
def initialize(a)
puts "Hello #{a}"
end
end
module Bar
def initialize(b)
puts "#{b} World"
end
end
class Sample < Foo
include Bar
def initialize(c)
super
end
end
Sample.new('qux') #=> qux World
爲什麼輸出不是'Hello qux'? credit for code紅寶石包含問題