Class: Cb::Clients::User
- Inherits:
-
Object
- Object
- Cb::Clients::User
- Defined in:
- lib/cb/clients/user.rb
Class Method Summary collapse
- .change_password(user_info) ⇒ Object
- .check_existing(email, password) ⇒ Object
- .delete(delete_criteria) ⇒ Object
- .retrieve(external_id, test_mode = false) ⇒ Object
- .temporary_password(external_id) ⇒ Object
Class Method Details
.change_password(user_info) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/cb/clients/user.rb', line 33 def change_password(user_info) my_api = Cb::Utils::Api.instance uri = Cb::configuration.uri_user_change_password response = my_api.cb_post(uri, :body => user_info.to_xml) Cb::Responses::User::ChangePassword.new(response) if response.has_key?('ResponseUserChangePW') end |
.check_existing(email, password) ⇒ Object
8 9 10 11 12 |
# File 'lib/cb/clients/user.rb', line 8 def check_existing(email, password) xml = build_check_existing_request(email, password) response = api_client.cb_post(Cb.configuration.uri_user_check_existing, body: xml) Cb::Responses::User::CheckExisting.new(response) end |
.delete(delete_criteria) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/cb/clients/user.rb', line 41 def delete(delete_criteria) my_api = Cb::Utils::Api.instance uri = Cb::configuration.uri_user_delete response = my_api.cb_post(uri, :body => delete_criteria.to_xml) Cb::Responses::User::Delete.new(response) if response.has_key?('ResponseUserDelete') end |
.retrieve(external_id, test_mode = false) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cb/clients/user.rb', line 20 def retrieve(external_id, test_mode = false) my_api = Cb::Utils::Api.instance json_hash = my_api.cb_post Cb.configuration.uri_user_retrieve, :body => build_retrieve_request(external_id, true) if json_hash.has_key? 'ResponseUserInfo' if json_hash['ResponseUserInfo'].has_key? 'UserInfo' user = Models::User.new json_hash['ResponseUserInfo']['UserInfo'] end my_api.append_api_responses user, json_hash['ResponseUserInfo'] end my_api.append_api_responses user, json_hash end |
.temporary_password(external_id) ⇒ Object
14 15 16 17 18 |
# File 'lib/cb/clients/user.rb', line 14 def temporary_password(external_id) query = { 'ExternalID' => external_id } response = api_client.cb_get(Cb.configuration.uri_user_temp_password, query: query) Cb::Responses::User::TemporaryPassword.new(response) end |