From: Daniel Berger Date: 2007-12-14T13:12:55+09:00 Subject: Re: attr_accessor for question methods (?) Trans wrote: > Like to make a small suggestion for 1.9. It would be great if we could > do: > > attr_accessor :foo? > > With the effect of: > > def foo? > @foo > end > > def foo=(x) > @foo=x > end > > This is much nice then having to define one attribute plus a > supplemental "?" method. attr_reader :foo? would work too, of course. > While it would be rather meaningless for attr_writer, it could work in > any case --really no need to raise an error. > > A minor detail, but one that would be convenient to have. I proposed this a while back and it got shot down for what were, IMO, very wrongheaded reasons. Maybe the 2nd time's the charm. Regards, Dan