From: "Zachary P. Landau" Date: 2004-01-30T05:02:05+09:00 Subject: Re: Why is def foo? legal but @foo? illegal? --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > >....but you can't name an instance variable with one: > > > > attr_reader(:foo?) > > def initialize > > @foo?=3Dtrue > > end >=20 > Don't know if it is possible, but I know the above won't work because=20 > you used attr_reader which will create a getter, but no setter for foo?.= =20 > Try changing it to attr_accessor and see if that works. But he wasn't using the accessor in initialize, he was changing the variable directly. foo? =3D true would be using the accessor. -- Zachary P. Landau GPG: gpg --recv-key 0x24E5AD99 | http://kapheine.hypa.net/kapheine.asc --pf9I7BMVVzbSWLtt Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAGWZQCwWyMCTlrZkRAiKqAJ9bZvpBWSjyzopL3CXKAQ9xP5Bq2ACeJeky 5RjrlLWjheEQi6Upsdw9MEI= =Sv7b -----END PGP SIGNATURE----- --pf9I7BMVVzbSWLtt--