From: Intransition Date: 2010-04-12T23:23:56+09:00 Subject: Re: attr_accessor, but for a boolean On Apr 11, 9:00 pm, Albert Schlef wrote: > Let's say I have this code: > > class Mambo >   attr_accesstor :safe > end > > Now, > > 'safe', in my case, is a boolean. Problem is, the getter will be named > 'safe', whereas I want it to be 'safe?'. In Ruby 1.9, once can create writers with attr :x= I love this feature b/c it means I can just use #attr and not need the other three attr_reader, attr_writer and attr_accessor. It would be cool if we could make "boolean" readers too with, attr :x? (P.S. Is the attr :x= feature going to get back ported to 1.8.8?)