diff options
| author | Burdette Lamar <BurdetteLamar@Yahoo.com> | 2025-10-26 02:04:40 -0500 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2025-10-26 07:05:24 +0000 |
| commit | e3a717512e6d374d5c2355fbeac07d32afffb27b (patch) | |
| tree | 0f4f217063bdec51235a2678431aa979ad9fffd7 | |
| parent | c6d1458421796786d26e084b48a0a4a7e3b40867 (diff) | |
[ruby/stringio] [DOC] Tweaks for StringIO#closed?
(https://github.com/ruby/stringio/pull/151)
https://github.com/ruby/stringio/commit/94bd4a3d87
| -rw-r--r-- | ext/stringio/stringio.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 965355df67..0dbf1fa3ec 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -614,8 +614,16 @@ strio_close_write(VALUE self) * call-seq: * closed? -> true or false * - * Returns +true+ if +self+ is closed for both reading and writing, - * +false+ otherwise. + * Returns whether +self+ is closed for both reading and writing: + * + * strio = StringIO.new + * strio.closed? # => false # Open for reading and writing. + * strio.close_read + * strio.closed? # => false # Still open for writing. + * strio.close_write + * strio.closed? # => true # Now closed for both. + * + * Related: StringIO.closed_read?, StringIO.closed_write?. */ static VALUE strio_closed(VALUE self) |
