From: Peer Allan Date: 2006-06-10T21:22:10+09:00 Subject: Re: Ruby Class question Justin Collins wrote: > James already answered the question pretty well, I just want to address > the "when does that line get executed?" question. > It is executed when the class is 'parsed'. For example: > > irb(main):001:0> class A > irb(main):002:1> puts "Hello!" > irb(main):003:1> end > Hello! > => nil > > Thanks for the explanations. This is what I was looking for. I did not realize that the code within the class definition gets executed, rather than just defined. Neat! Thanks again, Peer -- Posted via http://www.ruby-forum.com/.