class IssueCentre::AuthConnection
Public Class Methods
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
# File lib/issue_centre/auth_connection.rb, line 13 def initialize( auth_url, options = {}) super( auth_url, options) end
Public Instance Methods
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
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