class IssueCentre::AuthConnection

Public Class Methods

new( auth_url, options = {}) click to toggle source

Connection client for authenticating and retrieving contracts from IssueCentre

@param auth_url [String] IssueCentre endpoint url

(e.g. {https://support.callclosed.net/issuecentre/Connection})

@param options [Hash] Other options to pass to the constructors

@return [AuthConnection] Instance of AuthConnection client

Calls superclass method
# File lib/issue_centre/auth_connection.rb, line 13
def initialize( auth_url, options = {})
  super( auth_url, options)
end

Public Instance Methods

generate_key( username, password, contract) click to toggle source

Generate a contract-specific session key for this user from IssueCentre

@param [String] username A valid user in IssueCentre @param [String] password A valid password in IssueCentre @param [String] contract A valid contract for this user

@return [Array] Nokogiri::XML::Element array of return values

# File lib/issue_centre/auth_connection.rb, line 42
def generate_key( username, password, contract)
  response_xml = self.call( :generate_key, message: {
                              arg0: username,
                              arg1: password,
                              arg2: contract
                            })
  response = IssueCentre::Response.parse( response_xml,
                                          {contract_id: contract})
end
get_contracts( username, password) click to toggle source

Obtain possible contracts from IssueCentre for this user

@param [String] username A valid user in IssueCentre @param [String] password A valid password in IssueCentre

@return [Array] A array of valid contract hashes, one of which

may be marked as the default contract.
# File lib/issue_centre/auth_connection.rb, line 25
def get_contracts( username, password)
  response_xml = self.call( :get_contracts, message: {
                              arg0: username,
                              arg1: password
                            })
  response = IssueCentre::Response.parse( response_xml)
end