From 8313f803873a7c1b26ba58f85cb22b41463f4580 Mon Sep 17 00:00:00 2001 From: Peter Ohler Date: Sat, 21 Sep 2024 09:12:35 -0400 Subject: [PATCH] WIP --- ext/oj/string_writer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/oj/string_writer.c b/ext/oj/string_writer.c index cb5ff102..7dcb64b9 100644 --- a/ext/oj/string_writer.c +++ b/ext/oj/string_writer.c @@ -475,16 +475,16 @@ static VALUE str_writer_to_s(VALUE self) { } /* Document-method: as_json - * call-seq: as_json() + * call-seq: as_json(*) * * Returns the contents of the writer as a JSON element. If called from inside * an array or hash by Oj the raw buffer will be used othersize a more * inefficient parse of the contents and a return of the result is - * completed. The parse uses the strict mode. + * completed. The parse uses the strict mode. Optional arguments are ignored. * * *return* [_Hash_|_Array_|_String_|_Integer_|_Float_|_True_|_False_|_nil|) */ -static VALUE str_writer_as_json(VALUE self) { +static VALUE str_writer_as_json(int argc, VALUE *argv, VALUE self) { if (string_writer_optimized) { return self; } @@ -515,5 +515,5 @@ void oj_string_writer_init(void) { rb_define_method(oj_string_writer_class, "reset", str_writer_reset, 0); rb_define_method(oj_string_writer_class, "to_s", str_writer_to_s, 0); rb_define_method(oj_string_writer_class, "raw_json", str_writer_to_s, 0); - rb_define_method(oj_string_writer_class, "as_json", str_writer_as_json, 0); + rb_define_method(oj_string_writer_class, "as_json", str_writer_as_json, -1); }