Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Enumerator::ArithmeticSequence#inspect
() -> ::String
aseq.inspect → string
enumerator.c
View on GitHub ↗
static VALUE
arith_seq_inspect(VALUE self)
{
struct enumerator *e;
VALUE eobj, str;
int range_p;
TypedData_Get_Struct(self, struct enumerator, &enumerator_data_type, e);
eobj = rb_attr_get(self, id_receiver);
if (NIL_P(eobj)) {
eobj = e->obj;
}
range_p = RTEST(rb_obj_is_kind_of(eobj, rb_cRange));
str = rb_sprintf("(%s%"PRIsVALUE"%s.", range_p ? "(" : "", eobj, range_p ? ")" : "");
rb_str_buf_append(str, rb_id2str(e->meth));
append_method_args(eobj, str, e->args);
rb_str_buf_cat2(str, ")");
return str;
}
Convert this arithmetic sequence to a printable form.