From: "David A. Black" Date: 2004-08-12T23:53:51+09:00 Subject: Re: getting object attributes Hi -- On Thu, 12 Aug 2004, Sam McCall wrote: > David A. Black wrote: > > That will print: > > > > nil > > nil > > > > @goo and @boo are instance variables of the Class object Foo, not of > > its instances. > Rule #1 of this newsgroup should be: "Read the question twice" and > Rule #2 should be "test your answer". > The rules should be automatically appended to every post :-) > I looked at that and assumed those definitions were in the initialize > method. To be fair, I'm fairly sure that _was_ the intention ;-) I think it may have been... still waiting to hear from the OP on my request for clarification :-) > >> foo.instance_variable_set nil > > (You need two arguments for instance_variable_set :-) > comp.lang.ruby.instance_variable_set "@rule2" "test your answer" > Better? Yes -- you're only one comma away from having it parse :-) David -- David A. Black dblack@wobblini.net