From: Ryan Davis Date: 2013-04-12T17:37:03+09:00 Subject: Re: using an instance variable inside a method On Apr 11, 2013, at 21:38 , Matthew Kerwin wrote: > * note: it also defines a method called `p=` which assigns to `@p`, so > you can use `p = []` instead of `@p = []` if you want. C.f. attr_reader > and attr_writer No. you can use `self.p = []`, not `p = []`. That's the gotcha because the latter is treated as a local variable assign.