From: Josh Cheek on 12 Apr 2010 16:31 [Note: parts of this message were removed to make it a legal post.] On Mon, Apr 12, 2010 at 1:29 PM, Intransition <transfire(a)gmail.com> wrote: > > it's nicer to see true/false in the output. > > At other times you might want to see the underlying attribute. It's > easier to write '!!obj.safe?' then it is to write > 'obj.instance_eval{ @safe }'. > > I can understand wanting it either way depending on the situation. But > for an attr method I think it's probably best to side on doing less > rather than more, i.e. just making :a? a normal reader. But I wouldn't > bemoan it working one way or the other really. > > You could define save= , the setter for @safe safe , the getter for @safe safe? , returns !!safe Then you can use whichever makes the most sense for your particular use.
First
|
Prev
|
Pages: 1 2 3 Prev: [ANN] Harvested 0.3.0 Next: Google Wave: A new type of "Ruby Quiz" ? |