Forum: Ruby Newbie class question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9054a70a5ebc5824bc2a0b5465e7b342?d=identicon&s=25 C.t. Matsumoto (todd)
on 2006-02-19 16:27
Hi

I've been trying to get my head around the rules for making classes. One
question I have is whether a class must be initialized. Or can a class
just hold data without taking an argument.
3f591bcf8b0c5335f9acc85b6e83481b?d=identicon&s=25 matt.smillie@gmail.com (Guest)
on 2006-02-19 17:16
(Received via mailing list)
An initialised class (if I guess your meaning correctly) is called an
object or an instance.

Classes don't have to be initialised to hold data or methods, but from
a design perspective class methods and instance methods are used for
different things.  A class is usually a generic category, and an
instance of that class represents a particular object in that category.
 For instance, "Car" might be a class, and "my VW Jetta" would be an
instance of it.  Generally, most methods will likely be instance
methods, since it's instances that you're usually interested in.

Post an example of what you're trying to do - you'll likely get more
concrete advice.
This topic is locked and can not be replied to.