diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-17 23:01:50 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-17 23:01:50 +0000 |
commit | 1281cb00e53d2a4425fc28c3f75dee48e8e7a2d3 (patch) | |
tree | 0ef783f01acbc6a5b1412888bd974b826494f58f /eval_error.ci | |
parent | 97591e82d9ba3b7204110302b52540007ff081a5 (diff) | |
download | ruby-1281cb00e53d2a4425fc28c3f75dee48e8e7a2d3.tar.gz |
* proc.c (rb_obj_public_method): Object#public_method to retrieve
public method object.
* proc.c (rb_mod_public_instance_method): Module#public_instance_method
to retrieve public instance method from class / module.
* proc.c (mnew): visibility check added.
* eval_error.ci (rb_print_undef): add rb_ prefix.
* eval_error.ci (rb_print_undef): add visibility in the error
message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_error.ci')
-rw-r--r-- | eval_error.ci | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/eval_error.ci b/eval_error.ci index 210dce073d..94fb18029d 100644 --- a/eval_error.ci +++ b/eval_error.ci @@ -207,9 +207,17 @@ ruby_error_print(void) } void -print_undef(VALUE klass, ID id) +rb_print_undef(VALUE klass, ID id, int scope) { - rb_name_error(id, "undefined method `%s' for %s `%s'", + char *v; + + switch (scope) { + default: + case NOEX_PUBLIC: v = ""; break; + case NOEX_PRIVATE: v = " private"; break; + case NOEX_PROTECTED: v = " protected"; break; + } + rb_name_error(id, "undefined%s method `%s' for %s `%s'", v, rb_id2name(id), (TYPE(klass) == T_MODULE) ? "module" : "class", rb_class2name(klass)); |