Method: StringIO#write
- Defined in:
- ext/stringio/stringio.c
#write(string, ...) ⇒ Integer #syswrite(string) ⇒ Integer
Appends the given string to the underlying buffer string. The stream must be opened for writing. If the argument is not a string, it will be converted to a string using to_s. Returns the number of bytes written. See IO#write.
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 |
# File 'ext/stringio/stringio.c', line 1370 static VALUE strio_write_m(int argc, VALUE *argv, VALUE self) { long len = 0; while (argc-- > 0) { /* StringIO can't exceed long limit */ len += strio_write(self, *argv++); } return LONG2NUM(len); } |