From: Rick DeNatale Date: 2009-02-17T07:16:13+09:00 Subject: Re: Inherit and override in the same time? --0016361e7e7cf0ef6904631088e8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Mon, Feb 16, 2009 at 1:28 PM, Pit Capitain wrote: > 2009/2/16 Philippe Lang : > > I tried to rewrite my example so it shows a little bit better WHY I'm > > trying to do that. > > Philippe, you could introduce a new method, for example #product_search: > > class Form > def initialize > puts "form preparation" > end > def search_data > puts "form search preparation" > yield > puts "form search cleanup" > end > end > > class ProductForm < Form > def initialize > super > puts "product form widgets preparation" > end > def search_data > super do > product_search > end > end > def product_search > puts "product search" > end > end > > class ArchivedProductForm < ProductForm > def product_search > puts "archived product search" > end > end > > Exactly! This is what I recommended, recast into the "new" problem. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale --0016361e7e7cf0ef6904631088e8--