From: Qian Jigui Date: 2008-11-20T22:36:40+09:00 Subject: Re: How the Ruby's super work in finding method? Thanks for your help. Now I know more about the module, super, class and the method finding. The doesn't describe detail. Yossef Mendelssohn wrote: > On Nov 19, 9:23�pm, Qian Jigui wrote: > First of all, you can't define a method more than once. That is, > defining it a second time overwrites any previous definition, so if > you're expecting to see B, C, or D report 1, that's not going to > happen. > > Second, once a module is part of the ancestor chain, re-including it > doesn't do anything. You have B by itself, then C inherits from B, so > the lookup chain is > > C -> B > > Then C includes M > > C -> M -> B > > Then D inherits from C > > D -> C -> M -> B > > Then D includes M, but M is already present as an ancestor > > D -> C -> M -> B -- Posted via http://www.ruby-forum.com/.