February 2, 2004 Intro to Ruby Slide #22
Prev Next

Class methods

The names of class methods are preceded by the class name and a period:
     class Pony

         @@num_legs = 4

         def Pony.num_legs
             return @@num_legs
         end
     end


Prev Copyright © 2004 Walter C. Mankowski Next