From: Adam Shelly Date: 2006-03-15T07:05:34+09:00 Subject: Re: Scope of an @variable you need to use @@name. On 3/14/06, Nathan Olberding wrote: > I've got a class. I want some methods of this class to be able to edit > some data that's "global" within any given instance of this class. For > example: > > class Person > > @name > > def changeName(newName) > @name = newName > end > > def sayName() > puts "My name is " + @name > end > end > > It seems that @name reverts back once I leave the scope of any method > that manipulates it. > > -- > Posted via http://www.ruby-forum.com/. > >