From: Tom Stone Date: 2010-04-03T05:15:55+09:00 Subject: Re: A little help needed Jonathan Nielsen wrote: >> So it's a variable that is automtically given to each instance of that >> class right? > > Not quite... it's a variable in the instance that it is declared. So, > if you put it in the 'initialize' method as seen in that example, it > will assign that variable for that instance when it is created. > > -Jonathan Nielsen So... it's a variable that can only be used in that instance and nowhere else? such as: Class Test def initialize @x=5 end def testing puts"#{@x}" end end problem=Test.new problem.testing >5 #however puts"#{@x}" >error -- Posted via http://www.ruby-forum.com/.