diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-04-04 18:22:27 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-04-04 18:54:54 +0900 |
commit | 184db1fd6ab04cff2721c1e634e6ff31519fcd28 (patch) | |
tree | bd17a02d29260e7b4446bdea50858daba938c9f5 /io.c | |
parent | 64b0f4303e3551ca044e29100ace7927607a07e3 (diff) |
Update `ARGF.write` interface
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -14571,14 +14571,14 @@ argf_write_io(VALUE argf) /* * call-seq: - * ARGF.write(string) -> integer + * ARGF.write(*objects) -> integer * - * Writes _string_ if inplace mode. + * Writes each of the given +objects+ if inplace mode. */ static VALUE -argf_write(VALUE argf, VALUE str) +argf_write(int argc, VALUE *argv, VALUE argf) { - return rb_io_write(argf_write_io(argf), str); + return rb_io_writev(argf_write_io(argf), argc, argv); } void @@ -15823,7 +15823,7 @@ Init_IO(void) rb_define_method(rb_cARGF, "binmode", argf_binmode_m, 0); rb_define_method(rb_cARGF, "binmode?", argf_binmode_p, 0); - rb_define_method(rb_cARGF, "write", argf_write, 1); + rb_define_method(rb_cARGF, "write", argf_write, -1); rb_define_method(rb_cARGF, "print", rb_io_print, -1); rb_define_method(rb_cARGF, "putc", rb_io_putc, 1); rb_define_method(rb_cARGF, "puts", rb_io_puts, -1); |