Method: StringIO#close_read

Defined in:
stringio.c

#close_readnil

Closes the read end of a StringIO. Will raise an IOError if the strio is not readable.

Returns:

  • (nil)


363
364
365
366
367
368
369
370
371
372
# File 'stringio.c', line 363

static VALUE
strio_close_read(VALUE self)
{
    StringIO(self);
    if (!READABLE(self)) {
	rb_raise(rb_eIOError, "closing non-duplex IO for reading");
    }
    RBASIC(self)->flags &= ~STRIO_READABLE;
    return Qnil;
}