From c56b3d14181d0627cd044a21906fdb191a7f83f7 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 26 Jul 2014 16:13:21 +0000 Subject: eval_error.c: rb_print_inaccessible * eval_error.c (rb_print_inaccessible): exract from mnew_from_me() in proc.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index faede42d49..e9cffbf5a2 100644 --- a/proc.c +++ b/proc.c @@ -1219,16 +1219,7 @@ mnew_from_me(rb_method_entry_t *me, VALUE defined_class, VALUE klass, if (flag == NOEX_UNDEF) { flag = me->flag; if (scope && (flag & NOEX_MASK) != NOEX_PUBLIC) { - const char *v = ""; - switch (flag & NOEX_MASK) { - case NOEX_PRIVATE: v = "private"; break; - case NOEX_PROTECTED: v = "protected"; break; - } - rb_name_error(id, "method `%s' for %s `% "PRIsVALUE"' is %s", - rb_id2name(id), - (RB_TYPE_P(klass, T_MODULE)) ? "module" : "class", - rb_class_name(klass), - v); + rb_print_inaccessible(klass, id, flag & NOEX_MASK); } } if (def && def->type == VM_METHOD_TYPE_ZSUPER) { -- cgit v1.2.1