summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-25 09:16:25 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-25 09:16:25 +0000
commit6d47b8a9cc988bb210fc44ce991a0212d97296e4 (patch)
tree62abd8947818da9f117b0f2fe552b8b6f6c43a33 /object.c
parentaaa30fd040781355739b5cceb372df46851a2f5b (diff)
* eval.c (method_inspect): should not dump core for unbound
singleton methods. * object.c (rb_mod_to_s): better description. * hash.c (env_select): should path the assoc list. * process.c (rb_syswait): thread kludge; should be fixed to support native thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/object.c b/object.c
index 240a51c..bf22075 100644
--- a/object.c
+++ b/object.c
@@ -500,9 +500,17 @@ rb_mod_to_s(klass)
{
if (FL_TEST(klass, FL_SINGLETON)) {
VALUE s = rb_str_new2("#<");
+ VALUE v = rb_iv_get(klass, "__attached__");
rb_str_cat2(s, "Class:");
- rb_str_cat2(s, rb_class2name(klass));
+ switch (TYPE(v)) {
+ case T_CLASS: case T_MODULE:
+ rb_str_append(s, rb_inspect(v));
+ break;
+ default:
+ rb_str_append(s, rb_any_to_s(v));
+ break;
+ }
rb_str_cat2(s, ">");
return s;