instance method
StringIO#closed?
() -> bool
closed? → true or false
ext/stringio/stringio.c
View on GitHub ↗
static VALUE
strio_closed(VALUE self)
{
StringIO(self);
if (!CLOSED(self)) return Qfalse;
return Qtrue;
}
Returns whether self is closed for both reading and writing:
Example
strio = StringIO.new strio.closed? # => false # Open for reading and writing. strio.close_read strio.closed? # => false # Still open for writing. strio.close_write strio.closed? # => true # Now closed for both.
Related: StringIO.closed_read?, StringIO.closed_write?.