Trong Ruby (1.8.X)Tại sao Object bao gồm cả Kernel và kế thừa nó trong Ruby?
Tại sao đối tượng đều kế thừa hạt nhân và bao gồm? Sẽ không thừa kế là đủ?
irb(main):006:0> Object.ancestors => [Object, Kernel] irb(main):005:0> Object.included_modules => [Kernel] irb(main):011:0> Object.superclass => nil
Lưu ý trong Ruby 1.9 tình hình cũng tương tự (nhưng một chút bụi):
irb(main):001:0> Object.ancestors => [Object, Kernel, BasicObject] irb(main):002:0> Object.included_modules => [Kernel] irb(main):011:0> Object.superclass => BasicObject irb(main):011:0> BasicObject.superclass => nil irb(main):011:0> BasicObject.included_modules => []
dòng dưới cùng, tổ tiên và siêu lớp không bị nhầm lẫn –