Method: StringIO#close

Defined in:
ext/stringio/stringio.c

#closenil

Closes self for both reading and writing.

Raises IOError if reading or writing is attempted.

Related: StringIO#close_read, StringIO#close_write.

Returns:

  • (nil)


500
501
502
503
504
505
506
# File 'ext/stringio/stringio.c', line 500

static VALUE
strio_close(VALUE self)
{
    StringIO(self);
    RBASIC(self)->flags &= ~STRIO_READWRITE;
    return Qnil;
}