public Method

Array.empty?

array.empty?    true or false

Returns true if self array contains no elements.

[].empty?   #=> true

Source Code

/*
*  call-seq:
*     array.empty?   -> true or false
*  
*  Returns <code>true</code> if <i>self</i> array contains no elements.
*     
*     [].empty?   #=> true
*/

static VALUE
rb_ary_empty_p(ary)
   VALUE ary;
{
   if (RARRAY(ary)->len == 0)
       return Qtrue;
   return Qfalse;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.