From: Matt Date: 2001-07-24T05:46:51+09:00 Subject: [ruby-talk:18383] Re: More newbie questions On Tue, 24 Jul 2001, Dave Thomas wrote: > Matt writes: > > > cgi.out { cgi.p { cgi.rfc1123_date (Time.now) } } > > rfc1123_date is a class method of CGI, as opposed to an instance > method. This means you'd call it using > > CGI.rfc1123_date(Time.now) > > Here you're using the class (CGI) as the receiver of the message, as > opposed to an instance of the class (cgi in your example). OK. That worked! Now I'm confused (again) when to use the class and when to use an instance. For example take rfc1123_date. Why wasn't it inherited by the instance? I admit to not knowing enough about OO, but the only other language I've ever really tried was Perl's OO. And I hated it. ;) But thank you to both you and Sean Chittenden for your quick replies. Oh yeah, Sean: I'd take a closer look at mod_ruby (it looks cool), but I don't have root to compile it in. But I'll keep it in mind when I start using Ruby for CGI on one of my machines. :) --Matt P.S. Page numbers I should re-read in Programming Ruby may be helpful... I may have forgotten something painfully obvious, but it probably just didn't seem obvious at the time. I'm about to re-read it again from cover to cover anyway... :)