Class: WIN32OLE_METHOD
Relationships & Source Files | |
Inherits: | Object |
Defined in: | ext/win32ole/win32ole_method.c, ext/win32ole/win32ole_method.c |
Overview
WIN32OLE_METHOD
objects represent OLE method information.
Class Method Summary
-
.new(ole_type, method) ⇒ WIN32OLE_METHOD
constructor
Returns a new
WIN32OLE_METHOD
object which represents the information about OLE method.
Instance Attribute Summary
-
#event? ⇒ Boolean
readonly
Returns true if the method is event.
-
#visible? ⇒ Boolean
readonly
Returns true if the method is public.
Instance Method Summary
-
#dispid
Returns dispatch ID.
-
#event_interface
Returns event interface name if the method is event.
-
#helpcontext
Returns help context.
-
#helpfile
Returns help file.
-
#helpstring
Returns help string of OLE method.
-
#inspect ⇒ String
Returns the method name with class name.
-
WIN32OLE_MTHOD
Returns the method invoke kind.
-
#invoke_kind
Returns the method kind string.
-
#name
Alias for #to_s.
-
#offset_vtbl
Returns the offset ov VTBL.
-
#params
returns array of ::WIN32OLE_PARAM object corresponding with method parameters.
-
#return_type
Returns string of return value type of method.
-
#return_type_detail
Returns detail information of return value type of method.
-
#return_vtype
Returns number of return value type of method.
-
#size_opt_params
Returns the size of optional parameters.
-
#size_params
Returns the size of arguments of the method.
-
#to_s
(also: #name)
Returns the name of the method.
Constructor Details
.new(ole_type, method) ⇒ WIN32OLE_METHOD
Returns a new WIN32OLE_METHOD
object which represents the information about OLE method. The first argument ole_type specifies ::WIN32OLE_TYPE object. The second argument method specifies OLE method name defined OLE class which represents ::WIN32OLE_TYPE object.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
Instance Attribute Details
#event? ⇒ Boolean
(readonly)
Returns true if the method is event.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
puts method.event? # => true
#visible? ⇒ Boolean
(readonly)
Returns true if the method is public.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.visible? # => true
Instance Method Details
#dispid
Returns dispatch ID.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.dispid # => 181
#event_interface
Returns event interface name if the method is event.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
puts method.event_interface # => WorkbookEvents
#helpcontext
Returns help context.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.helpcontext # => 65717
#helpfile
Returns help file. If help file is not found, then the method returns nil.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.helpfile # => C:\...\VBAXL9.CHM
#helpstring
Returns help string of OLE method. If the help string is not found, then the method returns nil.
tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser')
method = WIN32OLE_METHOD.new(tobj, 'Navigate')
puts method.helpstring # => Navigates to a URL or file.
#inspect ⇒ String
Returns the method name with class name.
WIN32OLE_MTHOD
Returns the method invoke kind.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.invkind # => 1
#invoke_kind
Returns the method kind string. The string is “UNKNOWN” or “PROPERTY” or “PROPERTY” or “PROPERTYGET” or “PROPERTYPUT” or “PROPERTYPPUTREF” or “FUNC”.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.invoke_kind # => "FUNC"
#to_s
#name
Alias for #to_s.
#offset_vtbl
Returns the offset ov VTBL.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.offset_vtbl # => 40
#params
returns array of ::WIN32OLE_PARAM object corresponding with method parameters.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
p method.params # => [Filename, FileFormat, Password, WriteResPassword,
ReadOnlyRecommended, CreateBackup, AccessMode,
ConflictResolution, AddToMru, TextCodepage,
TextVisualLayout]
#return_type
Returns string of return value type of method.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.return_type # => Workbook
#return_type_detail
Returns detail information of return value type of method. The information is array.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
p method.return_type_detail # => ["PTR", "USERDEFINED", "Workbook"]
#return_vtype
Returns number of return value type of method.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.return_vtype # => 26
#size_opt_params
Returns the size of optional parameters.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.size_opt_params # => 4
#size_params
Returns the size of arguments of the method.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.size_params # => 11
#to_s Also known as: #name
Returns the name of the method.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.name # => SaveAs