From: Steve Tu Date: 2012-11-27T17:26:46+09:00 Subject: Re: Novice: Understanding instance 'variables' and methods I am nearly there! If I have class My_class attr_accessor :test end my_c = My_class.new my_c.test = 10 my_c.test Then I have automatically created two methods in My_class - the reader/writer - both with a method name of 'test'. my_c is then an instance of that class, and to access the variables I simply use my_c.test - BUT although my_c.test looks like it is a simple variable, it is really a call to a method of the name 'test'. This is where I had the problem with the symbols test above - as I wanted to get to the getter of test, not the setter. But it seemed that every time that I used t.test it invoked the setter. I'll look at the example again and try to see why I was getting that effect as I would guess that if I call the test method with an arg passed via the =, then it would invoke the setter, otherwise with no args it would invoke the getter (why doesn't Ruby use ? suffix on the getter - ie my_c.test? or t.test?). Thanks for all of your help. -- Posted via http://www.ruby-forum.com/.