Method: Enumerator::Lazy#select

Defined in:
enumerator.c

#find_all {|obj| ... } ⇒ Object #select {|obj| ... } ⇒ Object #filter {|obj| ... } ⇒ Object Also known as: _enumerable_select

Like Enumerable#select, but chains operation to be lazy-evaluated.

Overloads:

  • #find_all {|obj| ... } ⇒ Object

    Yields:

    • (obj)
  • #select {|obj| ... } ⇒ Object

    Yields:

    • (obj)
  • #filter {|obj| ... } ⇒ Object

    Yields:

    • (obj)


2132
2133
2134
2135
2136
2137
2138
2139
2140
# File 'enumerator.c', line 2132

static VALUE
lazy_select(VALUE obj)
{
    if (!rb_block_given_p()) {
	rb_raise(rb_eArgError, "tried to call lazy select without a block");
    }

    return lazy_add_method(obj, 0, 0, Qnil, Qnil, &lazy_select_funcs);
}