From: matt@... (Matt Neuburg) Date: 2010-08-09T02:42:36+09:00 Subject: Re: New in classes Amir Ebrahimifard wrote: > Hi > In the attached code what is the meaning of colored part of code? what > is the meaning those codes that showed when I wrote "Test.new" and > "variable = Test.new" ? > > Attachments: > http://www.ruby-forum.com/attachment/4926/capture.jpg You said "please instantiate the Test class". irb said "Okay, I did that; I made a new instance of Test, and here is its memory address so you can keep track of this instance later if you need to." Then you said "Well, that was stupid; I instantiated the Test class, but I didn't do anything about capturing that instance, so I have no way to refer to it. So this time, please instantiate the Test class and point to that instance with a variable called variable." irb said "Okay, I did that; I made a new instance of Test, and here is its memory address (pointed to by variable) so you can keep track of this instance later if you need to. By the way you can see from the address that this is a different instance from the one we made earlier." If you are a total beginner with the notion of classes and instances (it looks like you are), this might help you: http://www.apeth.com/rubyIntro/justenoughruby.html m. -- matt neuburg, phd = matt@tidbits.com A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.tidbits.com/matt/default.html#applescriptthings