From e3a717512e6d374d5c2355fbeac07d32afffb27b Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Sun, 26 Oct 2025 02:04:40 -0500 Subject: [ruby/stringio] [DOC] Tweaks for StringIO#closed? (https://github.com/ruby/stringio/pull/151) https://github.com/ruby/stringio/commit/94bd4a3d87 --- ext/stringio/stringio.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 965355df67..0dbf1fa3ec 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -614,8 +614,16 @@ strio_close_write(VALUE self) * call-seq: * closed? -> true or false * - * Returns +true+ if +self+ is closed for both reading and writing, - * +false+ otherwise. + * Returns whether +self+ is closed for both reading and writing: + * + * 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?. */ static VALUE strio_closed(VALUE self) -- cgit v1.2.3