diff options
Diffstat (limited to 'enumerator.c')
-rw-r--r-- | enumerator.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/enumerator.c b/enumerator.c index bd75b006f9..eaa3d73464 100644 --- a/enumerator.c +++ b/enumerator.c @@ -975,13 +975,15 @@ append_method(VALUE obj, VALUE str, ID default_method, VALUE default_args) method = rb_attr_get(obj, id_method); if (method != Qfalse) { - ID mid = default_method; if (!NIL_P(method)) { Check_Type(method, T_SYMBOL); - mid = SYM2ID(method); + method = rb_sym2str(method); + } + else { + method = rb_id2str(default_method); } rb_str_buf_cat2(str, ":"); - rb_str_buf_append(str, rb_id2str(mid)); + rb_str_buf_append(str, method); } eargs = rb_attr_get(obj, id_arguments); |