From: Nathan Olberding Date: 2006-04-08T02:32:16+09:00 Subject: Re: Simple Question About Deleting Instances zdennis wrote: > You are creating an instance variable @b on your class A. The class A is > an instance of the class Class, so it to can have instance variables. Not to be a whiner, but is there a reason we can't just do attr_accessor :@@var? What you're saying is logical, but it seems like we're getting from point A to point B via point F. > class A > @@a = 1 > > def initialize > @b = 2 > end > > def say_stuff > puts @@a > puts @b > end > end > > a = A.new > a.say_stuff > > Or: > ... > > You should really check this stuff out in IRB as well. Open a shell or > cmd.exe and type 'irb'. I do use irb (well, I write little test scripts and then run them through regular ruby, but same thing). I've done something else wrong: when I try this specifically the way you've outlined in a small test script, it works. Doing it that way in the script I'm working on generates errors. I guess I've got something else to look in to. -- Posted via http://www.ruby-forum.com/.