End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
StringIO#close_read
close_read → nil
ext/stringio/stringio.c
View on GitHub ↗
static VALUE
strio_close_read(VALUE self)
{
struct StringIO *ptr = StringIO(self);
if (!(ptr->flags & FMODE_READABLE)) {
rb_raise(rb_eIOError, "closing non-duplex IO for reading");
}
RBASIC(self)->flags &= ~STRIO_READABLE;
return Qnil;
}
Closes self for reading; closed-write setting remains unchanged.
Raises IOError if reading is attempted.
Related: StringIO#close, StringIO#close_write.