File tree Expand file tree Collapse file tree 1 file changed +17
-19
lines changed
Expand file tree Collapse file tree 1 file changed +17
-19
lines changed Original file line number Diff line number Diff line change @@ -3572,25 +3572,23 @@ io_buffer_not_inplace(VALUE self)
35723572 * \Buffer from string:
35733573 *
35743574 * string = 'data'
3575- * buffer = IO::Buffer.for(string)
3576- * # =>
3577- * # #<IO::Buffer 0x00007f3f02be9b18+4 SLICE>
3578- * # ...
3579- * buffer
3580- * # =>
3581- * # #<IO::Buffer 0x00007f3f02be9b18+4 SLICE>
3582- * # 0x00000000 64 61 74 61 data
3583- *
3584- * buffer.get_string(2) # read content starting from offset 2
3585- * # => "ta"
3586- * buffer.set_string('---', 1) # write content, starting from offset 1
3587- * # => 3
3588- * buffer
3589- * # =>
3590- * # #<IO::Buffer 0x00007f3f02be9b18+4 SLICE>
3591- * # 0x00000000 64 2d 2d 2d d---
3592- * string # original string changed, too
3593- * # => "d---"
3575+ * IO::Buffer.for(string) do |buffer|
3576+ * buffer
3577+ * # =>
3578+ * # #<IO::Buffer 0x00007f3f02be9b18+4 SLICE>
3579+ * # 0x00000000 64 61 74 61 data
3580+ *
3581+ * buffer.get_string(2) # read content starting from offset 2
3582+ * # => "ta"
3583+ * buffer.set_string('---', 1) # write content, starting from offset 1
3584+ * # => 3
3585+ * buffer
3586+ * # =>
3587+ * # #<IO::Buffer 0x00007f3f02be9b18+4 SLICE>
3588+ * # 0x00000000 64 2d 2d 2d d---
3589+ * string # original string changed, too
3590+ * # => "d---"
3591+ * end
35943592 *
35953593 * \Buffer from file:
35963594 *
You can’t perform that action at this time.
0 commit comments