From: jbrains762@... Date: 2007-12-18T22:16:40+09:00 Subject: Re: Newbie Question: What is a class for? I think of classes as a way to organize code that wants to share data, and nothing more. Once you have three methods that need the same parameter, consider moving them into a class and changing the parameters into fields. I'm jealous that you get to learn about classes without reading any of the misguided theory on OOD. Have fun! On 12/13/07, Matthias Borgeson wrote: > Hello all- > > I am a newbie to Ruby and have just recently gotten the hang of using > methods to hop in and out of the main body of my programs and am moving > to my next concept. > > I am now trying to grasp what a class isand what is is for. I understand > that there a bunch of different classes, but how does that help me? > > While I think of methods as little tools I can create to do things > whenever I want in the main program, I have no idea how a class used? I > have the Pickaxe and Chris Pine's book, but whle describing classes, > neither text really helps me understand what a class is and how it > functions in a ruby program. > > I looked through my C++ book to understand methods and how they are > anologous to functions, but now I am just confused on the concept. > > Any help or a point in the right direction would be appreciated > > Thanks in advance > > mfb > > > > > -- J. B. (Joe) Rainsberger :: http://www.jbrains.ca Your guide to software craftsmanship JUnit Recipes: Practical Methods for Programmer Testing 2005 Gordon Pask Award for contribution Agile Software Practice