From: Daniel Navarro Date: 2010-11-07T12:44:48+09:00 Subject: Re: Code in a class but not in a method -- please explain! --90e6ba6e8df635801404946e54dd Content-Type: text/plain; charset=ISO-8859-1 puts "Hello" it's considered local in environment. http://pine.fm/LearnToProgram/ Pretty good resource. Check it out. On Sat, Nov 6, 2010 at 10:22 PM, Bruce F. wrote: > I'm a newcomer to Ruby, and I'm confused about what executable > statements which are in a class definition, but not explicitly in a > method, mean. How are they executed? I assume that there's an implicit > method that they define; is that right? > > The most obvious example is the one-line program: > puts "Hello, World!" > > Since there's no explicit class definition, I understand that it's in an > automatically generated class (main). But, what method of that class is > it in? And, if it were an explicit class, how would I execute it? > (Apparently it's executed automatically if it's in main.) > > Thanks, > Bruce > > -- > Posted via http://www.ruby-forum.com/. > > -- Daniel Navarro 9035612340 --90e6ba6e8df635801404946e54dd--