ext/rjbexception.c in rjb-1.5.7 vs ext/rjbexception.c in rjb-1.5.8

- old
+ new

@@ -24,10 +24,16 @@ #endif #include "jniwrap.h" #include "riconv.h" #include "rjb.h" +static VALUE missing_delegate(int argc, VALUE* argv, VALUE self) +{ + ID rmid = rb_to_id(argv[0]); + return rb_funcall(rb_ivar_get(self, rb_intern("@cause")), rmid, argc - 1, argv + 1); +} + static VALUE get_cause(VALUE self) { return rb_funcall(rb_ivar_get(self, rb_intern("@cause")), rb_intern("cause"), 0); } @@ -58,9 +64,10 @@ rexp = rb_hash_aref(rjb_loaded_classes, cname); if (rexp == Qnil) { rexp = rb_define_class(pcls, rb_eStandardError); rb_define_method(rexp, "cause", get_cause, 0); + rb_define_method(rexp, "method_missing", missing_delegate, -1); #if defined(HAVE_RB_HASH_ASET) || defined(RUBINIUS) rb_hash_aset(rjb_loaded_classes, cname, rexp); #else #ifdef RHASH_TBL st_insert(RHASH_TBL(rjb_loaded_classes), cname, rexp);