"Matt Mower" <matt.mower / gmail.com> schrieb im Newsbeitrag news:d563731904121223321f545b28 / mail.gmail.com... > On Mon, 13 Dec 2004 16:12:04 +0900, Nicholas Van Weerdenburg > <vanweerd / gmail.com> wrote: > > On Mon, 13 Dec 2004 15:20:26 +0900, Miles Keaton <mileskeaton / gmail.com > wrote: > > > > For example, you can extend the Enumerable modules, and your changes > > apply to all objects in the system that use Enumerable: > > > > module Enumerable > > def each > > raise "you must implement each" > > end > > end > > > > Would this not introduce a breakage? IIRC the search order for > methods is object->modules->baseclass->baseclass modules. > > Hence if you mixed Enumerable into an object whose base class > imlemented #each you would *hide* the base-class implementation. > > Or have I got it wrong? (I'm still a learner). I think so: 10:34:52 [robert.klemme]: ruby -e 'p Array.ancestors' [Array, Enumerable, Object, Kernel] Kind regards robert