Module: AllscriptsUnityClient

Defined in:
lib/allscripts_unity_client.rb,
lib/allscripts_unity_client/client.rb,
lib/allscripts_unity_client/version.rb,
lib/allscripts_unity_client/utilities.rb,
lib/allscripts_unity_client/client_driver.rb,
lib/allscripts_unity_client/unity_request.rb,
lib/allscripts_unity_client/client_options.rb,
lib/allscripts_unity_client/unity_response.rb,
lib/allscripts_unity_client/json_client_driver.rb,
lib/allscripts_unity_client/json_unity_request.rb,
lib/allscripts_unity_client/json_unity_response.rb

Overview

A library for consuming Allscripts Unity web services.

Defined Under Namespace

Classes: APIError, Client, ClientDriver, ClientOptions, GetSecurityTokenError, JSONClientDriver, JSONUnityRequest, JSONUnityResponse, UnauthenticatedError, UnityRequest, UnityResponse, Utilities

Constant Summary collapse

VERSION =
'5.1.4'.freeze

Class Method Summary collapse

Class Method Details

.create(options = {}) ⇒ Object

Create an instance of the Unity client.

options

See ClientOptions.

Returns an instance of Client.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/allscripts_unity_client.rb', line 32

def self.create(options = {})
  options[:mode] ||= :json
  options[:raw_dates] ||= false
  if options[:log] != false # explicitly
    options[:log] = true
  end

  if options[:mode] == :json
    client_driver = JSONClientDriver.new(options)
  else
    raise ArgumentError, ':mode must be :json' unless options[:mode] == :json
  end

  Client.new(client_driver)
end