From: Dave Thomas Date: 2002-07-06T23:34:45+09:00 Subject: Re: self_parent Tom Sawyer writes: Well, if you'd like to remove duplication, how about (untested)... module ZenAcct class ZenCustomer < ZenRecord def initialize super('CUSTOMER', 'c') @subrecords = [ ZenAddress.new(self) ZenPhone.new(self) ZenBond.new(self) ZenNote.new(self) ZenURL.new(self) ] end # This would probably be in class ZenRecord... def invoke_sub(meth, *params) @subrecords.each {|sr| sr.send(meth, *params) end # def action super invoke_sub(:action, @act) end # Display the customer edit html def display @html = ZenCustomer_HTML.new(self) $cgi.out { @html.html_page(@title, 'com') } end # def load_dbi super invoke_sub(:load_dbi) end # def references ref = super if @edit_new invoke_sub(:update, @addresses.references) end return ref end # .... Cheers Dave