End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Range.new
Range.new(begin, end, exclude_end=false) → rng
range.c
View on GitHub ↗
static VALUE
range_initialize(int argc, VALUE *argv, VALUE range)
{
VALUE beg, end, flags;
rb_scan_args(argc, argv, "21", &beg, &end, &flags);
range_modify(range);
range_init(range, beg, end, RBOOL(RTEST(flags)));
return Qnil;
}
Constructs a range using the given begin and end. If the exclude_end parameter is omitted or is false, the range will include the end object; otherwise, it will be excluded.