From: Jean-Julien Fleck Date: 2010-08-02T01:49:04+09:00 Subject: Re: what is the correct way to extend native methods? Hello, > Why? Maybe it is forbidden to include a Module in a built-in class, for > security reasons, or... boh! :) Can you explain that? I think it has to do with inheritance when looking for methods. First, ruby look in the class itself to see if there is a method named 'slice'. When you try to extend Array, it find Array's original 'slice' and so does not need to look at the module (and never find your redefinition). If no method of that name is found in the class (like MyArray), it looks in the modules (if any) included in your class (and find one 'slice' in ExtendedSlicer) before looking at the ancestor class (which is Array). If I'm not mistaken, it should explain the observed behavior. All that (and more ! :o) is explained in David's book (The Well-Grounded Rubyist) in a crystal-clear manner around p100 of my version. Cheers, -- JJ Fleck PCSI1 Lycée Kléber