From: Stefano Crocco Date: 2009-05-03T02:13:53+09:00 Subject: Re: Help me understand 'self' vs current object On Saturday 02 May 2009, C. Dagnon wrote: > |The easy solution is to change is_deleted everywhere to self.is_deleted writing is_deleted = true creates a local variable and sets it to true. Since you don't use that variable anywhere in your method, I guess that's not what you want. I suppose what you want is to call the is_deleted= method which is an accessor for the @is_deleted instance variable. If it is so, then changing is_deleted= with self.is_deleted is not only an "easy solution" but "the" solution. The reason is that writing a_var = something always means: create a local variable called a_var and assign it the object something. If you want to call a method ending in = on the current object, you need to explicitly tell it to ruby, using self. > |but am I misunderstanding what 'self' is supposed to be? Is there > |another keyword which means what I've been lead to believe 'self' should > |mean? (ie. 'this' in Java) No, self is exactly what you think. I hope this helps Stefano