Class: IssueCentre::AuthConnection
- Inherits:
-
GenericConnection
- Object
- Savon::Client
- GenericConnection
- IssueCentre::AuthConnection
- Defined in:
- lib/issue_centre/auth_connection.rb
Instance Method Summary collapse
-
#generate_key(username, password, contract) ⇒ Array
Generate a contract-specific session key for this user from IssueCentre.
-
#get_contracts(username, password) ⇒ Array
Obtain possible contracts from IssueCentre for this user.
-
#initialize(auth_url, options = {}) ⇒ AuthConnection
constructor
Connection client for authenticating and retrieving contracts from IssueCentre.
Constructor Details
#initialize(auth_url, options = {}) ⇒ AuthConnection
Connection client for authenticating and retrieving contracts from IssueCentre
13 14 15 |
# File 'lib/issue_centre/auth_connection.rb', line 13 def initialize( auth_url, = {}) super( auth_url, ) end |
Instance Method Details
#generate_key(username, password, contract) ⇒ Array
Generate a contract-specific session key for this user from IssueCentre
42 43 44 45 46 47 48 49 50 |
# 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) ⇒ Array
Obtain possible contracts from IssueCentre for this user
25 26 27 28 29 30 31 |
# 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 |