Skip to content

Commit 2dd01c8

Browse files
BurdetteLamarkou
authored andcommitted
[ruby/stringio] [DOC] Tweaks for StringIO#close_write
(ruby/stringio#150) ruby/stringio@ea6e36f797 Co-authored-by: Sutou Kouhei <[email protected]>
1 parent a1a3857 commit 2dd01c8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ext/stringio/stringio.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,16 @@ strio_close_read(VALUE self)
600600
* call-seq:
601601
* close_write -> nil
602602
*
603-
* Closes +self+ for writing; closed-read setting remains unchanged.
603+
* Closes +self+ for writing; closed-read setting remains unchanged; returns +nil+:
604604
*
605-
* Raises IOError if writing is attempted.
605+
* strio = StringIO.new
606+
* strio.closed_write? # => false
607+
* strio.close_write # => nil
608+
* strio.closed_write? # => true
609+
* strio.closed_read? # => false
610+
* strio.write('foo') # Raises IOError: not opened for writing
606611
*
607-
* Related: StringIO#close, StringIO#close_read.
612+
* Related: StringIO#close, StringIO#close_read, StringIO#closed_write?.
608613
*/
609614
static VALUE
610615
strio_close_write(VALUE self)

0 commit comments

Comments
 (0)