Rails 2.2.2 to_date and to_datetime methods

Basic oop. Classes have class methods, instances hve instance methods.
Makes sense if you understand what a class is. Animal is a class. If
you want to create an instance, you say Animal.new. That gives you an
animal object which is not the class. It would have been better if
they'd called it new_instance, coz that's what it does. Now the
instance is a particular one. It's my cat named mrs Peabody. The class
represents the blueprint of what it is to be animal without any
particulars. I can't tell my cat "new" coz she doesn't respond to that
method. Only the class does. In this way, also, classes don't respond
to instance methods. Animal couldn't tell you its hair colour for
instance - it doesn't have hair. It does know that animals have hair
though! Get it? This is why active record model classes respond to the
find command. The model class represents the set of all of that class
of things, hence it's fairly well synonymous with a table of data Whig
is a collection of the PARTICULARs of that class of things. You
couldn't get a particular instance of a model object to find another
object for instance. - unless you particularly wanted that behaviour.

Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/