From: "David A. Black" Date: 2008-09-11T22:37:57+09:00 Subject: Re: define and call methods in ruby Hi -- On Thu, 11 Sep 2008, DanDiebolt.exe wrote: > You have to distinguish between instance methods and class methods. > > You appear to be asking how to create a class method. To do that you use > self.do_something: > > class Myclass > if something then > do_something > end > > def self.do_something > here something is done.. > end > end Though you'd have to define the method before you call it. David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates!