diff options
| author | Burdette Lamar <BurdetteLamar@Yahoo.com> | 2025-10-26 23:22:53 -0500 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2025-10-27 04:23:29 +0000 |
| commit | 2dd01c8f5c58faf084061ff687fb5f3d6a2cd264 (patch) | |
| tree | 0ee9cef05303859e4843770057892a76aece2ad4 /ext/stringio/stringio.c | |
| parent | a1a3857ccd71d9e97f7d6c3c9999969d0ab56b6b (diff) | |
[ruby/stringio] [DOC] Tweaks for StringIO#close_write
(https://github.com/ruby/stringio/pull/150)
https://github.com/ruby/stringio/commit/ea6e36f797
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Diffstat (limited to 'ext/stringio/stringio.c')
| -rw-r--r-- | ext/stringio/stringio.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 3bb2247fb0..50aea7642e 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -600,11 +600,16 @@ strio_close_read(VALUE self) * call-seq: * close_write -> nil * - * Closes +self+ for writing; closed-read setting remains unchanged. + * Closes +self+ for writing; closed-read setting remains unchanged; returns +nil+: * - * Raises IOError if writing is attempted. + * strio = StringIO.new + * strio.closed_write? # => false + * strio.close_write # => nil + * strio.closed_write? # => true + * strio.closed_read? # => false + * strio.write('foo') # Raises IOError: not opened for writing * - * Related: StringIO#close, StringIO#close_read. + * Related: StringIO#close, StringIO#close_read, StringIO#closed_write?. */ static VALUE strio_close_write(VALUE self) |
