Fw: RE: [Kansas-general] A boolean() method?
khaines at enigo.com
Wed Aug 25 11:30:43 EDT 2004
---------- Forwarded Message -----------
From: "Kirk Haines" <khaines at enigo.com>
To: "Berger, Daniel" <djberge at qwest.com>
Sent: Wed, 25 Aug 2004 11:25:02 -0400
Subject: RE: [Kansas-general] A boolean() method?
On Wed, 25 Aug 2004 10:10:33 -0500, Berger, Daniel wrote
> Seems like a reasonable idea. The syntax seems fine, though perhaps
> "boolean" isn't the best method name. I was thinking "found?",
> "row_returned?", "exists?" or something along those lines, since Ruby
> typically uses '?' as part of method names for methods that return true
> or false. But, that's up to you.
Yep. Those are all better names. I kind of like exists? since that is used
> Another possibility would be to do a 'count' behind the scenes and
> return an integer. In Oracle this would be a simple "select count(*)
> from foo where ...", though I have no idea how portable that is. You
> could always have both (assuming this doesn't already exist - I
> didn't check).
I have added a count() method, actually, and this exists? method,
internally, really breaks down to doing a count and seeing if the # is > 0.
------- End of Forwarded Message -------
More information about the Kansas-general