Class: AllscriptsUnityClient::ClientDriver

Inherits:
Object
  • Object
show all
Defined in:
lib/allscripts_unity_client/client_driver.rb

Overview

An abstract class for ClientDrivers that fully implement making calls to a Unity server.

Direct Known Subclasses

JSONClientDriver

Constant Summary collapse

LOG_FILE =
'logs/unity_client.log'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ClientDriver

Constructor.

options

See ClientOptions.



15
16
17
# File 'lib/allscripts_unity_client/client_driver.rb', line 15

def initialize(options)
  @options = ClientOptions.new(options)
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



10
11
12
# File 'lib/allscripts_unity_client/client_driver.rb', line 10

def options
  @options
end

#security_tokenObject

Returns the value of attribute security_token.



10
11
12
# File 'lib/allscripts_unity_client/client_driver.rb', line 10

def security_token
  @security_token
end

Instance Method Details

#client_typeObject

Returns the type of client, usually a symbol.



25
26
27
# File 'lib/allscripts_unity_client/client_driver.rb', line 25

def client_type
  :none
end

#get_security_token!(_parameters = {}) ⇒ Object

See Client#get_security_token!.

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/allscripts_unity_client/client_driver.rb', line 35

def get_security_token!(_parameters = {})
  raise NotImplementedError, 'get_security_token! not implemented'
end

#magic(_parameters = {}) ⇒ Object

See Client#magic.

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/allscripts_unity_client/client_driver.rb', line 30

def magic(_parameters = {})
  raise NotImplementedError, 'magic not implemented'
end

#retire_security_token!(_parameters = {}) ⇒ Object

See Client#retire_security_token!.

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/allscripts_unity_client/client_driver.rb', line 40

def retire_security_token!(_parameters = {})
  raise NotImplementedError, 'retire_security_token! not implemented'
end

#security_token?Boolean

Returns true if security token is not nil.

Returns:

  • (Boolean)


20
21
22
# File 'lib/allscripts_unity_client/client_driver.rb', line 20

def security_token?
  !@security_token.nil?
end