From 2dd01c8f5c58faf084061ff687fb5f3d6a2cd264 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Sun, 26 Oct 2025 23:22:53 -0500 Subject: [ruby/stringio] [DOC] Tweaks for StringIO#close_write (https://github.com/ruby/stringio/pull/150) https://github.com/ruby/stringio/commit/ea6e36f797 Co-authored-by: Sutou Kouhei --- ext/stringio/stringio.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 3bb2247fb0..50aea7642e 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -600,11 +600,16 @@ strio_close_read(VALUE self) * call-seq: * close_write -> nil * - * Closes +self+ for writing; closed-read setting remains unchanged. + * Closes +self+ for writing; closed-read setting remains unchanged; returns +nil+: * - * Raises IOError if writing is attempted. + * strio = StringIO.new + * strio.closed_write? # => false + * strio.close_write # => nil + * strio.closed_write? # => true + * strio.closed_read? # => false + * strio.write('foo') # Raises IOError: not opened for writing * - * Related: StringIO#close, StringIO#close_read. + * Related: StringIO#close, StringIO#close_read, StringIO#closed_write?. */ static VALUE strio_close_write(VALUE self) -- cgit v1.2.3