Class: AllscriptsUnityClient::ClientDriver
- Inherits:
-
Object
- Object
- AllscriptsUnityClient::ClientDriver
- Defined in:
- lib/allscripts_unity_client/client_driver.rb
Direct Known Subclasses
Constant Summary collapse
- LOG_FILE =
"logs/unity_client.log"
Instance Attribute Summary collapse
-
#appname ⇒ Object
Returns the value of attribute appname.
-
#base_unity_url ⇒ Object
Returns the value of attribute base_unity_url.
-
#log ⇒ Object
Returns the value of attribute log.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#password ⇒ Object
Returns the value of attribute password.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#security_token ⇒ Object
Returns the value of attribute security_token.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #client_type ⇒ Object
- #get_security_token!(parameters = {}) ⇒ Object
-
#initialize(base_unity_url, username, password, appname, proxy = nil, timezone = nil, logger = nil, log = true) ⇒ ClientDriver
constructor
A new instance of ClientDriver.
- #log? ⇒ Boolean
- #magic(parameters = {}) ⇒ Object
- #retire_security_token!(parameters = {}) ⇒ Object
- #security_token? ⇒ Boolean
Constructor Details
#initialize(base_unity_url, username, password, appname, proxy = nil, timezone = nil, logger = nil, log = true) ⇒ ClientDriver
Returns a new instance of ClientDriver.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 9 def initialize(base_unity_url, username, password, appname, proxy = nil, timezone = nil, logger = nil, log = true) raise ArgumentError, "base_unity_url can not be nil" if base_unity_url.nil? raise ArgumentError, "username can not be nil" if username.nil? raise ArgumentError, "password can not be nil" if password.nil? raise ArgumentError, "appname can not be nil" if appname.nil? @base_unity_url = base_unity_url.gsub /\/$/, "" @username = username @password = password @appname = appname @proxy = proxy @log = log if logger.nil? @logger = Logger.new(STDOUT) @logger.level = Logger::INFO else @logger = logger end unless timezone.nil? @timezone = Timezone.new(timezone) else @timezone = Timezone.new("UTC") end end |
Instance Attribute Details
#appname ⇒ Object
Returns the value of attribute appname.
7 8 9 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 7 def appname @appname end |
#base_unity_url ⇒ Object
Returns the value of attribute base_unity_url.
7 8 9 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 7 def base_unity_url @base_unity_url end |
#log ⇒ Object
Returns the value of attribute log.
7 8 9 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 7 def log @log end |
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 7 def logger @logger end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 7 def password @password end |
#proxy ⇒ Object
Returns the value of attribute proxy.
7 8 9 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 7 def proxy @proxy end |
#security_token ⇒ Object
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 |
#timezone ⇒ Object
Returns the value of attribute timezone.
7 8 9 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 7 def timezone @timezone end |
#username ⇒ Object
Returns the value of attribute username.
7 8 9 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 7 def username @username end |
Instance Method Details
#client_type ⇒ Object
44 45 46 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 44 def client_type return :none end |
#get_security_token!(parameters = {}) ⇒ Object
52 53 54 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 52 def get_security_token!(parameters = {}) raise NotImplementedError, "get_security_token! not implemented" end |
#log? ⇒ Boolean
40 41 42 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 40 def log? return @log end |
#magic(parameters = {}) ⇒ Object
48 49 50 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 48 def magic(parameters = {}) raise NotImplementedError, "magic not implemented" end |
#retire_security_token!(parameters = {}) ⇒ Object
56 57 58 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 56 def retire_security_token!(parameters = {}) raise NotImplementedError, "retire_security_token! not implemented" end |
#security_token? ⇒ Boolean
36 37 38 |
# File 'lib/allscripts_unity_client/client_driver.rb', line 36 def security_token? return !@security_token.nil? end |