Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Enumerator::Product#rewind
obj.rewind → obj
enumerator.c
View on GitHub ↗
static VALUE
enum_product_rewind(VALUE obj)
{
struct enum_product *ptr = enum_product_ptr(obj);
VALUE enums = ptr->enums;
long i;
for (i = 0; i < RARRAY_LEN(enums); i++) {
rb_check_funcall(RARRAY_AREF(enums, i), id_rewind, 0, 0);
}
return obj;
}
Rewinds the product enumerator by calling the “rewind” method on each enumerable in reverse order. Each call is performed only if the enumerable responds to the method.