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, DB_FORMAT_VALUES, DB_PAGE_SIZE_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
-
#dbformat=(value) ⇒ Object
Values for DBFormat.
-
#dbms=(value) ⇒ Object
Values for DBMS field.
-
#dbpagesize=(value) ⇒ Object
Values for DBPageSize.
-
#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.
246 247 248 249 |
# File 'lib/ass_launcher/support/connection_string.rb', line 246 def initialize(hash) fail ConnectionString::Error unless required_fields_received?(hash) _set_properties(hash) end |
Class Method Details
.fields ⇒ Object
238 239 240 |
# File 'lib/ass_launcher/support/connection_string.rb', line 238 def self.fields required_fields | COMMON_FIELDS | IB_MAKER_FIELDS end |
.required_fields ⇒ Object
242 243 244 |
# File 'lib/ass_launcher/support/connection_string.rb', line 242 def self.required_fields SERVER_FIELDS end |
Instance Method Details
#createinfobase_args ⇒ Object
Build args array suitable for :createinfibase runmode
289 290 291 |
# File 'lib/ass_launcher/support/connection_string.rb', line 289 def createinfobase_args [createinfobase_cmd.gsub(%r{=\s*"},"='").gsub(%r{"\s*;},"';")] end |
#createinfobase_cmd ⇒ Object
validte createinfibase params
Build string suitable for :createinfibase runmode
278 279 280 |
# File 'lib/ass_launcher/support/connection_string.rb', line 278 def createinfobase_cmd to_s(fields - %w{Usr Pwd}) end |
#crsqldb=(value) ⇒ Object
308 309 310 |
# File 'lib/ass_launcher/support/connection_string.rb', line 308 def crsqldb=(value) @crsqldb = yes_or_not(value) end |
#dbformat=(value) ⇒ Object
Values for DBFormat
299 300 301 |
# File 'lib/ass_launcher/support/connection_string.rb', line 299 def dbformat=(value) @dbformat = valid_value(value, DB_FORMAT_VALUES) end |
#dbms=(value) ⇒ Object
Values for DBMS field
304 305 306 |
# File 'lib/ass_launcher/support/connection_string.rb', line 304 def dbms=(value) @dbms = valid_value(value, DBMS_VALUES) end |
#dbpagesize=(value) ⇒ Object
Values for DBPageSize
294 295 296 |
# File 'lib/ass_launcher/support/connection_string.rb', line 294 def dbpagesize=(value) @dbpagesize = valid_value(value, DB_PAGE_SIZE_VALUES) end |
#ref=(str) ⇒ Object
262 263 264 265 |
# File 'lib/ass_launcher/support/connection_string.rb', line 262 def ref=(str) fail ArgumentError if str.empty? @ref = str end |
#schjobdn=(value) ⇒ Object
312 313 314 |
# File 'lib/ass_launcher/support/connection_string.rb', line 312 def schjobdn=(value) @schjobdn = yes_or_not(value) end |
#servers ⇒ Array<ServerDescr>
252 253 254 |
# File 'lib/ass_launcher/support/connection_string.rb', line 252 def servers @servers ||= [] end |
#srvr ⇒ Object
267 268 269 |
# File 'lib/ass_launcher/support/connection_string.rb', line 267 def srvr servers.join(',') end |
#srvr=(str) ⇒ Object
256 257 258 259 260 |
# File 'lib/ass_launcher/support/connection_string.rb', line 256 def srvr=(str) fail ArgumentError if str.empty? @servers = ServerDescr.parse(str) @srvr = str end |
#srvr_raw ⇒ Object
271 272 273 |
# File 'lib/ass_launcher/support/connection_string.rb', line 271 def srvr_raw @srvr end |
#to_ole_string ⇒ Object
Build string suitable for Ole objects connecting.
283 284 285 |
# File 'lib/ass_launcher/support/connection_string.rb', line 283 def to_ole_string "#{to_s(fields - IB_MAKER_FIELDS)}" end |