From: ara.t.howard@... Date: 2006-07-26T15:37:31+09:00 Subject: Re: Set an instance variable before and after initialize On Wed, 26 Jul 2006, Ben Nagy wrote: > What does this construction (r=super) do? I tried removing both references > to r and replacing it with a single 'super' and it seemed to behave > identically. it says: return whatever super used to. it's just good form when you wrap a method. >> include BeforeAfterInit >> >> before{ @a = 40 } >> after{ @b = 2 } > > When I define an initialize method here without using super, it breaks > (obvious, I guess), When I use super the before and after code gets run at > the same time - in other words: > > def initialize > p @a #should be set, but => nil but why? you haven't called super yet. try calling it first. -a -- suffering increases your inner strength. also, the wishing for suffering makes the suffering disappear. - h.h. the 14th dali lama