From: Bruce Woodward Date: 2006-04-12T06:38:09+09:00 Subject: Re: Equivalent of Java static code block in Ruby? ------=_Part_13275_5822039.1144791485305 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 4/11/06, Wes Gamble wrote: > > That's fine but I only want it executed ONCE the first time the class is > loaded. Wes, I don't about the first time that the class is loaded, but you get handle the first time that the class is instantiated. class Foo @@first_time =3D true def initialize if @@first_time puts "perform initialization" @@first_time =3D false end end end f =3D Foo.new ff =3D Foo.new cheers, Bruce. ------=_Part_13275_5822039.1144791485305--