Class: AssLauncher::Enterprise::Ole::IbConnection
- Inherits:
-
Object
- Object
- AssLauncher::Enterprise::Ole::IbConnection
- Defined in:
- lib/ass_launcher/enterprise/ole.rb
Overview
1C Infobase External Connection
Direct Known Subclasses
Instance Method Summary collapse
-
#__close__ ⇒ Object
Try close connection.
-
#__closed__? ⇒ Boolean
True if connection closed.
-
#__configure_com_connector__(opts) ⇒ Object
Set 1C Ole server properties.
-
#__open__(conn_str) ⇒ Object
Open connection in to infobase described in conn_str.
-
#__opened__? ⇒ Boolean
True if connection opened.
- #initialize(requirement) ⇒ Object constructor
Constructor Details
#initialize(requirement) ⇒ Object
22 23 24 |
# File 'lib/ass_launcher/enterprise/ole.rb', line 22 def initialize(requirement) @requirement = requirement.to_s end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object (protected)
Try call ole method
83 84 85 86 87 |
# File 'lib/ass_launcher/enterprise/ole.rb', line 83 def method_missing(method, *args) fail "Attempt call method for closed object #{self.class.name}"\ if __closed__? __ole__.send(method, *args) end |
Instance Method Details
#__close__ ⇒ Object
Note:
It not guaranteed real closing connection! Connection keep alive while have any alive WIN32OLE refs generated this connection. WIN32OLE#_<em>ass_ole_free</em>_ try kill refs but it work not always
Try close connection.
46 47 48 49 50 51 |
# File 'lib/ass_launcher/enterprise/ole.rb', line 46 def __close__ return true if __closed__? __ole__.send :__ass_ole_free__ @__ole__ = nil true end |
#__closed__? ⇒ Boolean
True if connection closed
54 55 56 |
# File 'lib/ass_launcher/enterprise/ole.rb', line 54 def __closed__? __ole__.nil? end |
#__configure_com_connector__(opts) ⇒ Object
Set 1C Ole server properties
64 65 66 67 68 |
# File 'lib/ass_launcher/enterprise/ole.rb', line 64 def __configure_com_connector__(opts) opts.each do |k, v| __ole_binary__.ole.setproperty(k, v) end end |
#__open__(conn_str) ⇒ Object
Open connection in to infobase described in conn_str
29 30 31 32 33 |
# File 'lib/ass_launcher/enterprise/ole.rb', line 29 def __open__(conn_str) return true if __opened__? __init_ole__(__ole_binary__.ole.connect(__cs__(conn_str))) true end |
#__opened__? ⇒ Boolean
True if connection opened
59 60 61 |
# File 'lib/ass_launcher/enterprise/ole.rb', line 59 def __opened__? !__closed__? end |