On Aug 3, 2009, at 11:11 PM, John W Higgins wrote:

> Good evening,
>
> On Mon, Aug 3, 2009 at 7:50 PM, Bertram Scharpf <lists / bertram-scharpf.de 
> >wrote:
>
>> Hi,
>>
>>
>> Anyway, it is still my opinion that there should be methods
>> Array#notempty?, Hash.notempty? and String.notempty? analogous to
>> Numeric#nonzero?. Expect me to repeat it soon.
>>
>
> Have you actually written the patch to implement these methods and  
> had it
> rejected? I can't imagine at least not getting a very good reason  
> from the
> core team why they wouldn't put it in if you have a patch in hand for
> them......
>
> John


Just take a look at the definition of blank? (and present?) from the  
ActiveSupport gem

activesupport-2.3.2/lib/active_support/core_ext/blank.rb

Yeah, it is bundled with Rails and this is the Ruby list, but it's  
only 58 lines (including comments and empty lines) of ruby code.

I typically add a NilClass#nonzero? just so nil plays nicely with  
Numeric#nonzero? myself.

-Rob

Rob Biedenharn		http://agileconsultingllc.com
Rob / AgileConsultingLLC.com