From: Paul Brannan Date: 2002-10-18T22:36:45+09:00 Subject: Re: Interfaces in Ruby On Fri, Oct 18, 2002 at 11:57:40AM +0900, Chris Gehlker wrote: > Example 1 > > __________ ________ > | Object | | Foo1 | > -------- |_______| > | | > \ / > \ / > \ / > \ / > \ / > \ / > \ / > \ / > \ / > | > V > ------- > | Bar1 | > ------- I think your diagram here is slightly off. Ruby has only single inheritance; there is no multiple inheritance, even if mixins give the illusion of (and often advantages of) MI. In this example, Bar1 inherits from a proxy class Foo1' which inherits from Object. To illustrate this better: class Base def foo puts "Base" end end module M1 def foo puts "M1" super end end module M2 def foo puts "M2" super end end class Derived < Base include M1 include M2 def foo puts "Derived" super end end d = Derived.new d.foo #=> Derived M2 M1 Base See also [ruby-talk:03591]. Paul