Skip to content

Commit fcf8b10

Browse files
BurdetteLamarmatzbot
authored andcommitted
[ruby/stringio] [DOC] Tweaks for StringIO#close_read
(ruby/stringio#149) ruby/stringio@11995db341
1 parent daaa09b commit fcf8b10

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ext/stringio/stringio.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,16 @@ strio_close(VALUE self)
572572
* call-seq:
573573
* close_read -> nil
574574
*
575-
* Closes +self+ for reading; closed-write setting remains unchanged.
575+
* Closes +self+ for reading;
576+
* closed-write setting remains unchanged;
577+
* returns +nil+:
576578
*
577-
* Raises IOError if reading is attempted.
579+
* strio = StringIO.new
580+
* strio.closed_read? # => false
581+
* strio.close_read # => nil
582+
* strio.closed_read? # => true
583+
* strio.closed_write? # => false
584+
* strio.read # Raises IOError: not opened for reading
578585
*
579586
* Related: StringIO#close, StringIO#close_write.
580587
*/

0 commit comments

Comments
 (0)