Class: AllscriptsUnityClient::ClientDriver

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

Direct Known Subclasses

JSONClientDriver, SOAPClientDriver

Constant Summary collapse

LOG_FILE =
'logs/unity_client.log'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ClientDriver

Returns a new instance of ClientDriver.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/allscripts_unity_client/client_driver.rb', line 9

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

  # If New Relic support is enabled, setup method tracing
  if @options.new_relic
    NewRelicSupport.enable_method_tracer(self)

    class << self
      add_method_tracer :magic
      add_method_tracer :get_security_token!
      add_method_tracer :retire_security_token!
    end
  end
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/allscripts_unity_client/client_driver.rb', line 7

def options
  @options
end

#security_tokenObject

Returns the value of attribute security_token.



7
8
9
# File 'lib/allscripts_unity_client/client_driver.rb', line 7

def security_token
  @security_token
end

Instance Method Details

#client_typeObject



28
29
30
# File 'lib/allscripts_unity_client/client_driver.rb', line 28

def client_type
  :none
end

#get_security_token!(parameters = {}) ⇒ Object

Raises:

  • (NotImplementedError)


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

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

#magic(parameters = {}) ⇒ Object

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/allscripts_unity_client/client_driver.rb', line 32

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

#retire_security_token!(parameters = {}) ⇒ Object

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:

  • (Boolean)


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

def security_token?
  !@security_token.nil?
end