Skip to content

Commit 46befe5

Browse files
committed
[DOC] Tweaks for StringIO#closed?
1 parent 7f46624 commit 46befe5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ext/stringio/stringio.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,16 @@ strio_close_write(VALUE self)
614614
* call-seq:
615615
* closed? -> true or false
616616
*
617-
* Returns +true+ if +self+ is closed for both reading and writing,
618-
* +false+ otherwise.
617+
* Returns whether +self+ is closed for both reading and writing:
618+
*
619+
* strio = StringIO.new
620+
* strio.closed? # => false # Open for reading and writing.
621+
* strio.close_read
622+
* strio.closed? # => false # Still open for writing.
623+
* strio.close_write
624+
* strio.closed? # => true # Now closed for both.
625+
*
626+
* Related: StringIO.closed_read?, StringIO.closed_write?.
619627
*/
620628
static VALUE
621629
strio_closed(VALUE self)

0 commit comments

Comments
 (0)