Sha256: 464ba514e6726e326f27a409ea0e8b0ba392e47779dae957eacc73ba692abe13

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

require 'active_support/time'
require 'allscripts_unity_client/utilities'
require 'allscripts_unity_client/unity_request'
require 'allscripts_unity_client/json_unity_request'
require 'allscripts_unity_client/unity_response'
require 'allscripts_unity_client/json_unity_response'
require 'allscripts_unity_client/client'
require 'allscripts_unity_client/client_driver'
require 'allscripts_unity_client/client_options'
require 'allscripts_unity_client/json_client_driver'

# A library for consuming Allscripts Unity web services.
module AllscriptsUnityClient

  # Any error returned from Unity is thrown as this error type
  # with the error message.
  class APIError < RuntimeError
  end

  # Create an instance of the Unity client.
  #
  # options:: See ClientOptions.
  #
  # Returns an instance of Client.
  def self.create(options = {})
    options[:mode] ||= :json
    if options[:log] != false # explictly
      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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
allscripts_unity_client-3.1.0 lib/allscripts_unity_client.rb
allscripts_unity_client-3.0.0 lib/allscripts_unity_client.rb