Bug #5865 ยป exc_equal.patch
| error.c | ||
|---|---|---|
|
CONST_ID(id_mesg, "mesg");
|
||
|
if (rb_obj_class(exc) != rb_obj_class(obj)) {
|
||
|
ID id_message, id_backtrace;
|
||
|
VALUE klass;
|
||
|
ID id_class, id_message, id_backtrace;
|
||
|
CONST_ID(id_class, "class");
|
||
|
CONST_ID(id_message, "message");
|
||
|
CONST_ID(id_backtrace, "backtrace");
|
||
|
klass = rb_check_funcall(obj, id_class, 0, 0);
|
||
|
if (klass == Qundef) return Qfalse;
|
||
|
if (!rb_equal(rb_obj_class(exc), klass))
|
||
|
return Qfalse;
|
||
|
mesg = rb_check_funcall(obj, id_message, 0, 0);
|
||
|
if (mesg == Qundef) return Qfalse;
|
||
|
backtrace = rb_check_funcall(obj, id_backtrace, 0, 0);
|
||
| lib/delegate.rb | ||
|---|---|---|
|
r
|
||
|
end
|
||
|
def class
|
||
|
__getobj__.class
|
||
|
end
|
||
|
#
|
||
|
# Returns the methods available to this delegate object as the union
|
||
|
# of this object's and \_\_getobj\_\_ methods.
|
||