SQLTerminal.app
now available

XPath.app
now available
Want fresh tech tips in your inbox?

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

Apps I've Built

XPath Expression Editor
Practice and improve your XPath skills with XPath Editor
Click to buy on the App Store
Photo Location Changer
Easily change the location on your photos and videos
Click here for more info about the app
Photo Date Changer
Easily change the dates and times on your photos and videos
Click here for more info about the app
VocabReminder
English dictionary with notifications so you won't forget what you're studying!
Click here for more info about the app
VocabQuiz
The app that quizzes and scores you on your vocabulary!
Click here for more info about the app