From: Hemant Kumar Date: 2007-01-11T14:34:47+09:00 Subject: Re: statement outside of any method in a class On Thu, 2007-01-11 at 13:42 +0900, Paul Smith wrote: > Thanks Hemant. However, as I mentioned in my last reply, it is not clear > to me what triggers the execution of a statement such as "sayfoo > :rubyrocks" in your example. When the class is loaded, when an instance > is created, ??? > > Thanks. On a broader perspective, we can say when the class is loaded, when you define a class like this in your code: class Baz < Foobar sayfoo :rubyrocks end An object called Baz starts to exist in current Runtime, which is an instance of class Class. So, when method sayfoo gets invoked when object Baz is created or in other words, we can say when class is loaded.