cb-api 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,23 @@ module Cb
26
26
  result
27
27
  end
28
28
 
29
+ def self.delete external_id, password, test_mode = false
30
+ result = false
31
+
32
+ my_api = Cb::Utils::Api.new
33
+ cb_response = my_api.cb_post Cb.configuration.uri_user_delete, :body => build_delete_request(external_id, password, test_mode)
34
+ json_hash = JSON.parse cb_response.response.body
35
+
36
+ my_api.append_api_responses result, json_hash['ResponseUserDelete']
37
+
38
+ if result.cb_response.status.include? 'Success'
39
+ result = true
40
+ my_api.append_api_responses result, json_hash['ResponseUserDelete']
41
+ end
42
+
43
+ result
44
+ end
45
+
29
46
  private
30
47
  def self.build_change_password_request external_id, old_password, new_password, test_mode
31
48
  builder = Nokogiri::XML::Builder.new do
@@ -41,5 +58,18 @@ module Cb
41
58
  builder.to_xml
42
59
  end
43
60
 
61
+ def self.build_delete_request external_id, password, test_mode
62
+ builder = Nokogiri::XML::Builder.new do
63
+ Request {
64
+ ExternalID_ external_id
65
+ Password_ password
66
+ Test_ test_mode.to_s
67
+ DeveloperKey_ Cb.configuration.dev_key
68
+ }
69
+ end
70
+
71
+ builder.to_xml
72
+ end
73
+
44
74
  end
45
75
  end
@@ -7,7 +7,8 @@ module Cb
7
7
  :uri_recommendation_for_job, :uri_recommendation_for_user,
8
8
  :uri_recommendation_for_company,
9
9
  :uri_application, :uri_application_submit,
10
- :uri_application_registered, :uri_user_change_password
10
+ :uri_application_registered, :uri_user_change_password,
11
+ :uri_user_delete
11
12
 
12
13
  def initialize
13
14
  Cb::Utils::Country.inject_convenience_methods
@@ -28,6 +29,7 @@ module Cb
28
29
  @uri_application_submit ||= '/v1/Application/submit'
29
30
  @uri_application_registered ||= '/v3/Application/registered'
30
31
  @uri_user_change_password ||= '/v2/User/ChangePW'
32
+ @uri_user_delete ||= '/v2/User/delete'
31
33
  end
32
34
 
33
35
  def to_hash
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,17 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jesse Retchko
9
9
  - Chris Little
10
10
  - Miriam Williams
11
+ - David Posey
12
+ - Kyle Bumpus
11
13
  autorequire:
12
14
  bindir: bin
13
15
  cert_chain: []
14
- date: 2013-05-24 00:00:00.000000000 Z
16
+ date: 2013-05-29 00:00:00.000000000 Z
15
17
  dependencies:
16
18
  - !ruby/object:Gem::Dependency
17
19
  name: httparty
@@ -50,6 +52,8 @@ email:
50
52
  - Jesse.Retchko@Careerbuilder.com
51
53
  - Chris.Little@Careerbuilder.com
52
54
  - MiriamDeana@gmail.com
55
+ - David.Posey@Careerbuilder.com
56
+ - Kyle.Bumpus@Careerbuilder.com
53
57
  executables: []
54
58
  extensions: []
55
59
  extra_rdoc_files: []