From: Eric Mahurin Date: 2005-10-20T23:31:52+09:00 Subject: Re: [ANN] [RCR] Cut-based AOP --- Pit Capitain wrote: > Eric Mahurin schrieb: > > module Braces > > remove_method :foo > > end > > > > c.foo # => "[bar]" > > > > I really like this. I don't see anything you couldn't do > with > > this that you can with the cut-based-AOP. And it seems so > much > > simpler. > > I like it too, but instead of having to remove methods from > modules, it > would be better if we could "exclude" modules from the > inheritance > chain. Will this be possible in Ruby 2? Yep, that might be useful too. So you'd do this instead: class C exclude Braces end Another end case you have to think about is if a class precludes the same module twice. Does it wrap the method twice? And if so, does "excluding" it remove both wraps. > Another question: how would I "preclude" a module to an > instance? > > Module: include <-> preclude > Instance: extend <-> ?? (pretend :-) > > Regards, > Pit Yes, I was just thinking about that too. "pretend" was the first that came to my mind too :) But, you could also do it manually: class < "{[foo]}" class C unwrap Brackets end c.foo # => "{foo}" __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com