summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-04-08 09:13:30 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-04-08 09:13:30 +0000
commit29ba4ff416d20334e8553b50f4d5f994e0c62090 (patch)
tree6f00c1ff232421fedbd78b1bf1cc0adf87c7c6eb /ext
parentde558c7995f3c4dcd31b261be0488b547b931715 (diff)
add WIN32OLE_METHOD#inspect, WIN32OLE_PARAM#inspect
add test/win32ole/test_win32ole_param.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/win32ole/win32ole.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 393eef6737..dc99536343 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -79,7 +79,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "0.7.4"
+#define WIN32OLE_VERSION "0.7.5"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -6233,6 +6233,13 @@ folemethod_params(self)
return ole_method_params(pmethod->pTypeInfo, pmethod->index);
}
+static VALUE
+folemethod_inspect(self)
+ VALUE self;
+{
+ return default_inspect(self, "WIN32OLE_METHOD");
+}
+
/*
* Document-class: WIN32OLE_PARAM
*
@@ -6502,6 +6509,20 @@ static VALUE foleparam_default(self)
pparam->index);
}
+static VALUE
+foleparam_inspect(self)
+ VALUE self;
+{
+ VALUE detail = foleparam_name(self);
+ VALUE defval = foleparam_default(self);
+ if (defval != Qnil) {
+ rb_str_cat2(detail, "=");
+ rb_str_concat(detail, rb_funcall(defval, rb_intern("inspect"), 0));
+ }
+ return make_inspect("WIN32OLE_PARAM", detail);
+}
+
+
/*
* Document-class: WIN32OLE_EVENT
@@ -7484,6 +7505,7 @@ Init_win32ole()
rb_define_method(cWIN32OLE_METHOD, "size_opt_params", folemethod_size_opt_params, 0);
rb_define_method(cWIN32OLE_METHOD, "params", folemethod_params, 0);
rb_define_alias(cWIN32OLE_METHOD, "to_s", "name");
+ rb_define_method(cWIN32OLE_METHOD, "inspect", folemethod_inspect, 0);
cWIN32OLE_PARAM = rb_define_class("WIN32OLE_PARAM", rb_cObject);
rb_define_method(cWIN32OLE_PARAM, "name", foleparam_name, 0);
@@ -7495,13 +7517,12 @@ Init_win32ole()
rb_define_method(cWIN32OLE_PARAM, "retval?", foleparam_retval, 0);
rb_define_method(cWIN32OLE_PARAM, "default", foleparam_default, 0);
rb_define_alias(cWIN32OLE_PARAM, "to_s", "name");
+ rb_define_method(cWIN32OLE_PARAM, "inspect", foleparam_inspect, 0);
cWIN32OLE_EVENT = rb_define_class("WIN32OLE_EVENT", rb_cObject);
-
+ rb_define_singleton_method(cWIN32OLE_EVENT, "message_loop", fev_s_msg_loop, 0);
rb_define_alloc_func(cWIN32OLE_EVENT, fev_s_allocate);
rb_define_method(cWIN32OLE_EVENT, "initialize", fev_initialize, -1);
- rb_define_singleton_method(cWIN32OLE_EVENT, "message_loop", fev_s_msg_loop, 0);
-
rb_define_method(cWIN32OLE_EVENT, "on_event", fev_on_event, -1);
rb_define_method(cWIN32OLE_EVENT, "on_event_with_outargs", fev_on_event_with_outargs, -1);