Class: AssLauncher::Support::ConnectionString::Server
- Inherits:
-
Object
- Object
- AssLauncher::Support::ConnectionString::Server
- Includes:
- AssLauncher::Support::ConnectionString
- Defined in:
- lib/ass_launcher/support/connection_string.rb
Overview
All connection string class have methods for get and set values of defined fields. Methods have name as fields but in downcase All fields defined for connection string class retutn #fields
Connection string for server-infobases
Defined Under Namespace
Classes: ServerDescr
Constant Summary
Constants included from AssLauncher::Support::ConnectionString
COMMON_FIELDS, DBMS_VALUES, FILE_FIELDS, HTTP_FIELDS, HTTP_WEB_AUTH_FIELDS, IB_MAKER_FIELDS, PROXY_FIELDS, SERVER_FIELDS
Class Method Summary collapse
Instance Method Summary collapse
-
#createinfobase_args ⇒ Object
Build args array suitable for :createinfibase runmode.
-
#createinfobase_cmd ⇒ Object
Build string suitable for :createinfibase runmode.
- #crsqldb=(value) ⇒ Object
-
#dbms=(value) ⇒ Object
Values for DBMS field.
-
#initialize(hash) ⇒ Server
constructor
A new instance of Server.
- #ref=(str) ⇒ Object
- #schjobdn=(value) ⇒ Object
- #servers ⇒ Array<ServerDescr>
- #srvr ⇒ Object
- #srvr=(str) ⇒ Object
- #srvr_raw ⇒ Object
-
#to_ole_string ⇒ Object
Build string suitable for Ole objects connecting.
Methods included from AssLauncher::Support::ConnectionString
#fields, included, #is, #is?, new, parse, #required_fields, #to_args, #to_cmd, #to_hash, #to_s
Constructor Details
#initialize(hash) ⇒ Server
Returns a new instance of Server.
238 239 240 241 |
# File 'lib/ass_launcher/support/connection_string.rb', line 238 def initialize(hash) fail ConnectionString::Error unless required_fields_received?(hash) _set_properties(hash) end |
Class Method Details
.fields ⇒ Object
230 231 232 |
# File 'lib/ass_launcher/support/connection_string.rb', line 230 def self.fields required_fields | COMMON_FIELDS | IB_MAKER_FIELDS end |
.required_fields ⇒ Object
234 235 236 |
# File 'lib/ass_launcher/support/connection_string.rb', line 234 def self.required_fields SERVER_FIELDS end |
Instance Method Details
#createinfobase_args ⇒ Object
Build args array suitable for :createinfibase runmode
281 282 283 |
# File 'lib/ass_launcher/support/connection_string.rb', line 281 def createinfobase_args [createinfobase_cmd.gsub(%r{=\s*"},"='").gsub(%r{"\s*;},"';")] end |
#createinfobase_cmd ⇒ Object
validte createinfibase params
Build string suitable for :createinfibase runmode
270 271 272 |
# File 'lib/ass_launcher/support/connection_string.rb', line 270 def createinfobase_cmd to_s end |
#crsqldb=(value) ⇒ Object
290 291 292 |
# File 'lib/ass_launcher/support/connection_string.rb', line 290 def crsqldb=(value) @crsqldb = yes_or_not(value) end |
#dbms=(value) ⇒ Object
Values for DBMS field
286 287 288 |
# File 'lib/ass_launcher/support/connection_string.rb', line 286 def dbms=(value) @dbms = valid_value(value, DBMS_VALUES) end |
#ref=(str) ⇒ Object
254 255 256 257 |
# File 'lib/ass_launcher/support/connection_string.rb', line 254 def ref=(str) fail ArgumentError if str.empty? @ref = str end |
#schjobdn=(value) ⇒ Object
294 295 296 |
# File 'lib/ass_launcher/support/connection_string.rb', line 294 def schjobdn=(value) @schjobdn = yes_or_not(value) end |
#servers ⇒ Array<ServerDescr>
244 245 246 |
# File 'lib/ass_launcher/support/connection_string.rb', line 244 def servers @servers ||= [] end |
#srvr ⇒ Object
259 260 261 |
# File 'lib/ass_launcher/support/connection_string.rb', line 259 def srvr servers.join(',') end |
#srvr=(str) ⇒ Object
248 249 250 251 252 |
# File 'lib/ass_launcher/support/connection_string.rb', line 248 def srvr=(str) fail ArgumentError if str.empty? @servers = ServerDescr.parse(str) @srvr = str end |
#srvr_raw ⇒ Object
263 264 265 |
# File 'lib/ass_launcher/support/connection_string.rb', line 263 def srvr_raw @srvr end |
#to_ole_string ⇒ Object
Build string suitable for Ole objects connecting.
275 276 277 |
# File 'lib/ass_launcher/support/connection_string.rb', line 275 def to_ole_string "#{to_s(fields - IB_MAKER_FIELDS)}" end |