method
method_missing
v2_6_3 -
Show latest stable
- Class:
WIN32OLE
method_missing(*args)public
Calls WIN32OLE#invoke method.
static VALUE
fole_missing(int argc, VALUE *argv, VALUE self)
{
VALUE mid, org_mid, sym, v;
const char* mname;
long n;
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
mid = org_mid = argv[0];
sym = rb_check_symbol(&mid);
if (!NIL_P(sym)) mid = rb_sym2str(sym);
mname = StringValueCStr(mid);
if(!mname) {
rb_raise(rb_eRuntimeError, "fail: unknown method or property");
}
n = RSTRING_LEN(mid);
if(mname[n-1] == '=') {
rb_check_arity(argc, 2, 2);
argv[0] = rb_enc_associate(rb_str_subseq(mid, 0, n-1), cWIN32OLE_enc);
return ole_propertyput(self, argv[0], argv[1]);
}
else {
argv[0] = rb_enc_associate(rb_str_dup(mid), cWIN32OLE_enc);
v = ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE);
if (v == rb_eNoMethodError) {
argv[0] = org_mid;
return rb_call_super(argc, argv);
}
return v;
}
} Related methods
- Instance methods
- []
- []=
- _getproperty
- _invoke
- _setproperty
- each
- invoke
- method_missing
- methods
- ole_activex_initialize
- ole_free
- ole_func_methods
- ole_get_methods
- ole_method
- ole_method_help
- ole_methods
- ole_obj_help
- ole_put_methods
- ole_query_interface
- ole_respond_to?
- ole_type
- ole_typelib
- setproperty
- Class methods
- codepage
- codepage=
- connect
- const_load
- create_guid
- locale
- locale=
- new
- ole_free
- ole_initialize
- ole_reference_count
- ole_show_help
- ole_uninitialize
- Private methods
-
ole_methods_safely