diff options
author | zverok <[email protected]> | 2019-11-20 02:33:20 +0200 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2019-11-20 13:42:56 +0900 |
commit | 50cc9341450cfbdf9a40df3d38600d8d2854a0a3 (patch) | |
tree | 8f946d146e2dca794c05cc63de6f6ef0947f8e01 /proc.c | |
parent | baf482bab4776f781c3569d9f581e38bbf0548e1 (diff) |
Update representation (discussed on ruby tracker)
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2618
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -2830,7 +2830,6 @@ method_inspect(VALUE method) { VALUE params = rb_method_parameters(method); VALUE pair, name, kind; - int arg_num = 1; const VALUE req = ID2SYM(rb_intern("req")); const VALUE opt = ID2SYM(rb_intern("opt")); const VALUE keyreq = ID2SYM(rb_intern("keyreq")); @@ -2850,8 +2849,7 @@ method_inspect(VALUE method) if (NIL_P(name) || name == Qfalse) { // FIXME: can it be reduced to switch/case? if (kind == req || kind == opt) { - name = rb_sprintf("arg%d", arg_num); - arg_num++; + name = rb_str_new2("_"); } else if (kind == rest || kind == keyrest) { name = rb_str_new2(""); } else if (kind == block) { @@ -2864,11 +2862,11 @@ method_inspect(VALUE method) if (kind == req) { rb_str_catf(str, "%"PRIsVALUE, name); } else if (kind == opt) { - rb_str_catf(str, "%"PRIsVALUE"=<default>", name); + rb_str_catf(str, "%"PRIsVALUE"=...", name); } else if (kind == keyreq) { rb_str_catf(str, "%"PRIsVALUE":", name); } else if (kind == key) { - rb_str_catf(str, "%"PRIsVALUE": <default>", name); + rb_str_catf(str, "%"PRIsVALUE": ...", name); } else if (kind == rest) { rb_str_catf(str, "*%"PRIsVALUE, name); } else if (kind == keyrest) { |