From: Mike Onofrietto Date: 2011-02-12T11:19:07+09:00 Subject: Re: attr_reader vs Objects and Attributes Robert, Thanks. The code, and output(?) I pasted, and attached are from the Thomas, and Hunt manual. The other attachment was some similar test code of mine. The issue was my lack of understanding as to why they wrote the methods without any initialization. Thanks again, Mike Robert Klemme wrote in post #980811: > On Thu, Feb 10, 2011 at 9:33 AM, Brian Candler > wrote: >> @artist=artist >> pinpointed the error. > I believe he did not get an error message but an empty (nil) output > (other than he wrote): > > Ruby version 1.9.2 > irb(main):001:0> class Song; end > => nil > irb(main):002:0> s = Song.new("Bicylops", "Fleck", 260) > => # > irb(main):003:0> s.instance_variables > => [] > > At least that would have been the case with the code he pasted. > > Mike, your pasted code and output do not match. Also the code that > you referenced is not the one in the attachment. Please make sure you > report the real code and the real issue. > > Cheers > > robert -- Posted via http://www.ruby-forum.com/.