From: "Shot (Piotr Szotkowski)" Date: 2010-02-23T01:31:34+09:00 Subject: Re: Is there a way to get a method to always run at the end of any descendent's initialize method? --jRHKVT23PllUwdXP Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Xeno Campanoli: > I have an initialize method I want to run at the end of any daughter > or granddaughter 'initialize' to make sure the state has been created > properly, and I would rather specify the execution from the base class > itself than count on those descendents to do it. Other than what others already said, you could try either an AOP solution like Aquarium or Gazer (both seem unmaintained) or RCapture (my personal favourite), which seems to be alive. http://cheind.wordpress.com/2010/01/07/introducing-rcapture/ http://code.google.com/p/rcapture/ http://www.elctech.com/projects/aspect-oriented-programming-in-ruby-with-ga= zer http://github.com/teejayvanslyke/gazer http://aquarium.rubyforge.org/ =E2=80=94 Shot --=20 I should like to find the person who decided that since =E2=80=98bookmarks=E2=80=99 and =E2=80=98history=E2=80=99 were both lists o= f URLs they ought to be integrated in a single database. I should like to shake him warmly by the throat until his head comes off. [Roger Burton West on Firefox, hates-software] --jRHKVT23PllUwdXP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkuCsVwACgkQi/mCfdEo8UqfUACff/IUxowr9klENdWTH29HUedu u2AAmwRDje6fHGOP0oVaxBCRwkbtO7nF =McSY -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP--