diff --git a/io_buffer.c b/io_buffer.c index 5210d4732b..e6ca61bdae 100644 --- a/io_buffer.c +++ b/io_buffer.c @@ -3572,25 +3572,23 @@ io_buffer_not_inplace(VALUE self) * \Buffer from string: * * string = 'data' - * buffer = IO::Buffer.for(string) - * # => - * # # - * # ... - * buffer - * # => - * # # - * # 0x00000000 64 61 74 61 data + * IO::Buffer.for(string) do |buffer| + * buffer + * # => + * # # + * # 0x00000000 64 61 74 61 data * - * buffer.get_string(2) # read content starting from offset 2 - * # => "ta" - * buffer.set_string('---', 1) # write content, starting from offset 1 - * # => 3 - * buffer - * # => - * # # - * # 0x00000000 64 2d 2d 2d d--- - * string # original string changed, too - * # => "d---" + * buffer.get_string(2) # read content starting from offset 2 + * # => "ta" + * buffer.set_string('---', 1) # write content, starting from offset 1 + * # => 3 + * buffer + * # => + * # # + * # 0x00000000 64 2d 2d 2d d--- + * string # original string changed, too + * # => "d---" + * end * * \Buffer from file: *