Skip to content

Commit

Permalink
[fix #77] make sure to call #description with Objective-C objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed May 17, 2012
1 parent 092ad9e commit 600bb24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions object.c
Expand Up @@ -473,8 +473,9 @@ rb_obj_inspect(VALUE obj, SEL sel)
}
}
}
else if (!SPECIAL_CONST_P(obj) && !RCLASS_RUBY(RBASIC(obj)->klass)) {
return rb_str_new3(rb_vm_call(obj, selDescription, 0, 0));
else if (!SPECIAL_CONST_P(obj) &&
!(RCLASS_RUBY(obj) || RCLASS_RUBY(RBASIC(obj)->klass))) {
return rb_str_new3(rb_vm_call(obj, selDescription, 0, 0));
}
return rb_funcall(obj, rb_intern("to_s"), 0, 0);
}
Expand Down

0 comments on commit 600bb24

Please sign in to comment.