| | 1035 | } |
| | 1036 | |
| | 1037 | /* |
| | 1038 | * call-seq: |
| | 1039 | * Sandbox::Ref.method_missing => obj |
| | 1040 | * |
| | 1041 | * Executes the method under the class (or object)'s original environment, |
| | 1042 | * passing in and returning references as needed. |
| | 1043 | */ |
| | 1044 | static VALUE |
| | 1045 | sandbox_ref_method_missing(argc, argv, self) |
| | 1046 | int argc; |
| | 1047 | VALUE *argv; |
| | 1048 | VALUE self; |
| | 1049 | { |
| | 1050 | VALUE link = sandbox_get_linked_class(self); |
| | 1051 | if (NIL_P(link)) { |
| | 1052 | /* FIXME: oh, wait, this shouldn't happen! */ |
| | 1053 | rb_raise(rb_eNoMethodError, "no link for %s", RSTRING(rb_inspect(self))->ptr); |
| | 1054 | } else if (!SYMBOL_P(argv[0])) { |
| | 1055 | rb_raise(rb_eArgError, "method_missing expects a symbolized method name"); |
| | 1056 | } else { |
| | 1057 | int i; |
| | 1058 | sandkit *kit; |
| | 1059 | VALUE box = sandbox_get_linked_box(self); |
| | 1060 | Data_Get_Struct(box, sandkit, kit); |
| | 1061 | return sandbox_run(kit, sandbox_method_wick(link, argc, argv)); |
| | 1062 | } |