End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Date#upto
d.upto(max) → enumerator
d.upto(max){|date| ...} → self
ext/date/date_core.c
View on GitHub ↗
static VALUE
d_lite_upto(VALUE self, VALUE max)
{
VALUE date;
RETURN_ENUMERATOR(self, 1, &max);
date = self;
while (FIX2INT(d_lite_cmp(date, max)) <= 0) {
rb_yield(date);
date = d_lite_plus(date, INT2FIX(1));
}
return self;
}
This method is equivalent to step(max, 1){|date| …}.