RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: mjc
Site: http://325i.org
I was looking for a good way to explain it, and found this. :)
def self.foo creates a class method.
"Class methods are methods that are called on a class and instance methods are methods that are called on an instance of a class."
via http://www.railstips.org/blog/archives/2009/05/11/class-and-instance-methods-in-ruby/
I was looking for a good way to explain it, and found this. :)
def self.foo creates a class method.
"Class methods are methods that are called on a class and instance methods are methods that are called on an instance of a class."
via http://www.railstips.org/blog/archives/2009/05/11/class-and-instance-methods-in-ruby/