Class: AssLauncher::Enterprise::Ole::ThinApplication

Inherits:
IbConnection
  • Object
show all
Defined in:
lib/ass_launcher/enterprise/ole.rb

Overview

Wrapper for V8xc.Application ole object

Direct Known Subclasses

ThickApplication

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from IbConnection

#__configure_com_connector__

Constructor Details

#initialize(requirement) ⇒ ThinApplication

Returns a new instance of ThinApplication.



127
128
129
130
# File 'lib/ass_launcher/enterprise/ole.rb', line 127

def initialize(requirement)
  super
  @opened = false
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AssLauncher::Enterprise::Ole::IbConnection

Class Method Details

.close_allObject

Close all opened connectons



123
124
125
# File 'lib/ass_launcher/enterprise/ole.rb', line 123

def self.close_all
  objects.each(&:__close__)
end

.objectsObject

Array of objects with opened connection for close all



118
119
120
# File 'lib/ass_launcher/enterprise/ole.rb', line 118

def self.objects
  @objects ||= []
end

Instance Method Details

#__close__Object



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/ass_launcher/enterprise/ole.rb', line 164

def __close__
  return true if __closed__?
  # rubocop:disable HandleExceptions
  begin
    __ole__.terminate
  rescue
    # NOP
  ensure
    @__ole_binary__ = nil
    @opened = false
    ThinApplication.objects.delete(self)
  end
  # rubocop:enable HandleExceptions
  true
end

#__closed__?Boolean

Returns:

  • (Boolean)


160
161
162
# File 'lib/ass_launcher/enterprise/ole.rb', line 160

def __closed__?
  !__opened__?
end

#__open__(conn_str) ⇒ Object

Open connection in to infobase described in conn_str



134
135
136
137
138
139
# File 'lib/ass_launcher/enterprise/ole.rb', line 134

def __open__(conn_str)
  return true if __opened__?
  __try_open__(conn_str)
  self.class.objects << self
  __opened__?
end

#__opened__?Boolean

Returns:

  • (Boolean)


156
157
158
# File 'lib/ass_launcher/enterprise/ole.rb', line 156

def __opened__?
  @opened
end