Module: COM
- Defined in:
- lib/com.rb,
lib/com/version.rb
Overview
COM is an object-oriented wrapper around WIN32OLE. COM makes it easy to add behavior to WIN32OLE objects, making them easier to work with from Ruby.
Defined Under Namespace
Modules: HResultError, PatternError, StandardError Classes: Error, Events, Instantiable, MethodInvocationError, Object, Wrapper
Constant Summary collapse
- Version =
'0.3.1'
Class Method Summary collapse
-
.charset ⇒ String
Gets the iconv character set equivalent of the current COM code page.
-
.connect(id) ⇒ COM::MethodMissing
Connects to a running COM object.
-
.new(id, host = nil) ⇒ COM::MethodMissing
Creates a new COM object.
Class Method Details
.charset ⇒ String
Gets the iconv character set equivalent of the current COM code page.
23 24 25 26 27 |
# File 'lib/com.rb', line 23 def charset COMCodePageToIconvCharset[WIN32OLE.codepage] or raise 'no iconv charset associated with current COM codepage: %s' % WIN32OLE.codepage end |
.connect(id) ⇒ COM::MethodMissing
Connects to a running COM object.
This method shouldn’t be used directly, but rather is used by COM::Object.
39 40 41 42 43 |
# File 'lib/com.rb', line 39 def connect(id) Wrapper.new(WIN32OLE.connect(id)) rescue WIN32OLERuntimeError => e raise Error.from(e) end |
.new(id, host = nil) ⇒ COM::MethodMissing
Creates a new COM object.
This method shouldn’t be used directly, but rather is used by COM::Object.
55 56 57 58 59 |
# File 'lib/com.rb', line 55 def new(id, host = nil) Wrapper.new(WIN32OLE.new(id, host)) rescue WIN32OLERuntimeError => e raise Error.from(e) end |