method
method_missing
v2_2_9 -
Show latest stable
- Class:
WIN32OLE
method_missing(*args)public
Calls WIN32OLE#invoke method.
static VALUE
fole_missing(int argc, VALUE *argv, VALUE self)
{
ID id;
const char* mname;
size_t n;
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
id = rb_to_id(argv[0]);
mname = rb_id2name(id);
if(!mname) {
rb_raise(rb_eRuntimeError, "fail: unknown method or property");
}
n = strlen(mname);
#if SIZEOF_SIZE_T > SIZEOF_LONG
if (n >= LONG_MAX) {
rb_raise(rb_eRuntimeError, "too long method or property name");
}
#endif
if(mname[n-1] == '=') {
rb_check_arity(argc, 2, 2);
argv[0] = rb_enc_str_new(mname, (long)(n-1), cWIN32OLE_enc);
return ole_propertyput(self, argv[0], argv[1]);
}
else {
argv[0] = rb_enc_str_new(mname, (long)n, cWIN32OLE_enc);
return ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE);
}
} Related methods
- Instance methods
- []
- []=
- _getproperty
- _invoke
- _setproperty
- each
- invoke
- method_missing
- 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