VocabReminder
Easily build a great vocabulary without studying! Now on the App Store!
Click here for more info about the app

Class

       


# Define a class with a class method "find"
# Usage
# Apple.find("macintosh")
class Apple
   def self.find(variety)
      # code goes here
   end
end


# Same as above but notice the lack of self prefix before the method name
# Usage
# Apple.find("macintosh")
class Apple
   class << self
      def find(variety)
         # code goes here
      end
   end
end

See the full pastie here: http://pastie.org/2580020

Tagged w/ #ruby