Multiple inheritance is a feature of object-oriented computer programing languages in which a class can inherit(Inheritance is a relation between two classes) characteristics and features from more than one superclass. It is distinct to single inheritance, where a class may only inherit from one particular superclass.
Ruby doesn't support Multiple inheritance . Ruby has single inheritance(each class has one and only one parent class). Example: All cats are mammals, and all mammals are animals.The benefit of inheritance is that classes lower down the hierarchy get the features of those higher up, but can also add specific features of their own. If all mammals breathe, then all cats breathe. class ClassA puts :A end class ClassB puts :B end # will not work class Inheritor < ClassA, ClassB puts :A puts :B end # To make things work: module ModuleA puts :A end module ModuleB puts :B end
# class Inheritor mixin ModuleA,ModuleB modulesclass Inheritor include ModuleA include ModuleB puts :I end I hope it give small clarification on ruby inheritance features.