--001636457ade240857049c2ab8c6 Content-Type: text/plain; charset=UTF-8 Hm, interesting question. Can you give an example of when you might need to un-assign a role? It only lasts for the length of the request anyway, if I understand correctly. On Sun, Feb 13, 2011 at 5:51 AM, Michel Demazure <michel / demazure.com>wrote: > The following post is interesting > > http://andrzejonsoftware.blogspot.com/2011/02/dci-and-rails.html > > In the DCI way, an object can be assigned a role by extending a module > bringing the methods pertaining to this role > > obj lass.new > obj extend Role > > But, how to change roles, without cluttering the metaclass hierarchy ? > > obj unextend Role # ? > obj extend NewRole > > But, even with an ah-hoc unextend, one needs to remember the old role. > Therefore, what about a 'temp_extend Module' method, which clears the > previous 'temp_extension' ? > > _md > > -- > Posted via http://www.ruby-forum.com/. > > --001636457ade240857049c2ab8c6--