summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2025-10-26 20:02:02 -0500
committergit <svn-admin@ruby-lang.org>2025-10-27 01:02:38 +0000
commitfcf8b10b3c674eecf16c14fa6ee7f4211fa3b673 (patch)
tree7a4639cf5911463cfeb40d3510bbebe8e9566a50
parentdaaa09bcc2c803ed52f744207d6f951d5b363226 (diff)
[ruby/stringio] [DOC] Tweaks for StringIO#close_read
(https://github.com/ruby/stringio/pull/149) https://github.com/ruby/stringio/commit/11995db341
-rw-r--r--ext/stringio/stringio.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index d593508e46..3bb2247fb0 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -572,9 +572,16 @@ strio_close(VALUE self)
* call-seq:
* close_read -> nil
*
- * Closes +self+ for reading; closed-write setting remains unchanged.
+ * Closes +self+ for reading;
+ * closed-write setting remains unchanged;
+ * returns +nil+:
*
- * Raises IOError if reading is attempted.
+ * strio = StringIO.new
+ * strio.closed_read? # => false
+ * strio.close_read # => nil
+ * strio.closed_read? # => true
+ * strio.closed_write? # => false
+ * strio.read # Raises IOError: not opened for reading
*
* Related: StringIO#close, StringIO#close_write.
*/