Skip to content

Commit 877ebe5

Browse files
BurdetteLamarmatzbot
authored andcommitted
[ruby/stringio] [DOC] Tweaks for StringIO#close
(ruby/stringio#148) Make examples do more work (instead of text). ruby/stringio@7f4662438f
1 parent 230276d commit 877ebe5

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
@@ -549,11 +549,16 @@ strio_set_string(VALUE self, VALUE string)
549549
* call-seq:
550550
* close -> nil
551551
*
552-
* Closes +self+ for both reading and writing.
552+
* Closes +self+ for both reading and writing; returns +nil+:
553553
*
554-
* Raises IOError if reading or writing is attempted.
554+
* strio = StringIO.new
555+
* strio.closed? # => false
556+
* strio.close # => nil
557+
* strio.closed? # => true
558+
* strio.read # Raises IOError: not opened for reading
559+
* strio.write # Raises IOError: not opened for writing
555560
*
556-
* Related: StringIO#close_read, StringIO#close_write.
561+
* Related: StringIO#close_read, StringIO#close_write, StringIO.closed?.
557562
*/
558563
static VALUE
559564
strio_close(VALUE self)

0 commit comments

Comments
 (0)