End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
StringIO#reopen
strio.reopen(other_StrIO) → strio
strio.reopen(string, mode) → strio
ext/stringio/stringio.c
View on GitHub ↗
static VALUE
strio_reopen(int argc, VALUE *argv, VALUE self)
{
rb_io_taint_check(self);
if (argc == 1 && !RB_TYPE_P(*argv, T_STRING)) {
return strio_copy(self, *argv);
}
return strio_init(argc, argv, StringIO(self), self);
}
Reinitializes the stream with the given other_StrIO or string and mode (see StringIO#new).