Method: Array#reject

Defined in:
array.c

#reject {|item| ... } ⇒ Object #rejectEnumerator

Returns a new array containing the items in self for which the given block is not true. The ordering of non-rejected elements is maintained.

See also Array#delete_if

If no block is given, an Enumerator is returned instead.

Overloads:



3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
# File 'array.c', line 3234

static VALUE
rb_ary_reject(VALUE ary)
{
    VALUE rejected_ary;

    RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
    rejected_ary = rb_ary_new();
    ary_reject(ary, rejected_ary);
    return rejected_ary;
}