From: Lyle Johnson Date: 2003-01-22T04:17:54+09:00 Subject: Re: Mixins Gennady wrote: > I am completely lost -- it looks like it is not possible to redefine a > method at all with a mixin: > > class Test > def foo > puts "Test#foo" > end > end > > module Mixin > def foo > puts "Mixin#foo" > end > def bar > puts "Mixin#bar" > end > end > > class Test > include Mixin > end > > Test.new.foo #==> Test#foo > Test.new.bar #==> Mixin#bar > > So new method are added just fine, however a method I would like to > redefine stays the same. Is it how it was supposed to work? Yes, this is how it's supposed to work. When you mix a module into a class, the module more-or-less acts as a superclass of the class it's mixed-into. So for your example, Test#foo is redefining the Module#foo method.