cb-api 20.6.0 → 21.0.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -0
  3. data/lib/cb/{requests/data_lists/desired_job_type.rb → clients/browser_id.rb} +8 -8
  4. data/lib/cb/clients/data_list.rb +40 -0
  5. data/lib/cb/config.rb +2 -18
  6. data/lib/cb/convenience.rb +4 -16
  7. data/lib/cb/exceptions.rb +7 -2
  8. data/lib/cb/utils/response_map.rb +1 -16
  9. data/lib/cb/utils/validator.rb +13 -2
  10. data/lib/cb/version.rb +1 -1
  11. metadata +6 -44
  12. data/lib/cb/clients/category.rb +0 -55
  13. data/lib/cb/clients/education.rb +0 -35
  14. data/lib/cb/clients/employee_types.rb +0 -36
  15. data/lib/cb/clients/industry.rb +0 -23
  16. data/lib/cb/models/implementations/category.rb +0 -34
  17. data/lib/cb/models/implementations/cover_letter.rb +0 -25
  18. data/lib/cb/models/implementations/data_lists/resume_data_list.rb +0 -26
  19. data/lib/cb/models/implementations/education.rb +0 -27
  20. data/lib/cb/models/implementations/employee_type.rb +0 -23
  21. data/lib/cb/models/implementations/industry.rb +0 -32
  22. data/lib/cb/models/implementations/work_status.rb +0 -33
  23. data/lib/cb/requests/category/search.rb +0 -33
  24. data/lib/cb/requests/cover_letter/delete.rb +0 -38
  25. data/lib/cb/requests/cover_letter/list.rb +0 -31
  26. data/lib/cb/requests/cover_letter/retrieve.rb +0 -34
  27. data/lib/cb/requests/cover_letter/update.rb +0 -40
  28. data/lib/cb/requests/data_lists/countries.rb +0 -23
  29. data/lib/cb/requests/data_lists/data_list_base.rb +0 -50
  30. data/lib/cb/requests/data_lists/education_codes.rb +0 -23
  31. data/lib/cb/requests/data_lists/languages.rb +0 -23
  32. data/lib/cb/requests/data_lists/state.rb +0 -38
  33. data/lib/cb/requests/education/get.rb +0 -33
  34. data/lib/cb/requests/resumes/language_codes.rb +0 -34
  35. data/lib/cb/requests/resumes/list.rb +0 -34
  36. data/lib/cb/requests/work_status/list.rb +0 -33
  37. data/lib/cb/responses/category/search.rb +0 -53
  38. data/lib/cb/responses/cover_letter/delete.rb +0 -27
  39. data/lib/cb/responses/cover_letter/list.rb +0 -39
  40. data/lib/cb/responses/cover_letter/retrieve.rb +0 -39
  41. data/lib/cb/responses/cover_letter/status.rb +0 -31
  42. data/lib/cb/responses/cover_letter/update.rb +0 -27
  43. data/lib/cb/responses/data_list/state.rb +0 -31
  44. data/lib/cb/responses/data_lists/resume_data_list.rb +0 -41
  45. data/lib/cb/responses/education/get.rb +0 -53
  46. data/lib/cb/responses/employee_types/search.rb +0 -55
  47. data/lib/cb/responses/industry/search.rb +0 -55
  48. data/lib/cb/responses/resumes/language_codes.rb +0 -45
  49. data/lib/cb/responses/resumes/resume_list.rb +0 -31
  50. data/lib/cb/responses/work_status/list.rb +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ebf3d91e8e5051506d3abae76a85f6b6899a7eb
4
- data.tar.gz: 487c0fd6cfdc67f2cc986e5ed3dd7e79f40a1942
3
+ metadata.gz: b7e19d70cab2649c025de49534b275afd9b308d2
4
+ data.tar.gz: bdf7609d52ca8a32bbaecd4dbb162b7ba4aa4e19
5
5
  SHA512:
6
- metadata.gz: 7fca2ea3870480e5ff88df8b0dd78603984278589ee4fcdc1e0e8f9b6d88beb2affac3244484468e7bbe2dec2d35fdaea5dfd4cd8b3aa7a5f07f47d6d9c81135
7
- data.tar.gz: b33e15bdab0b83e59b3c3e7b8f6a267dfa9c2f346fefa9093309e6b42a70fc481bc336a17b338ab2e1795747da82b706da8c389c18019d683cd1465806feb00a
6
+ metadata.gz: aa8324c2875139f92061c44979c896677a57a6b0052531b36ea907edc601cca4f2c54cf2d6b498f15d0fd2c1a8ae516ed915c5a31d23f6bb9d21c1a3205cdb54
7
+ data.tar.gz: cab598d13aaa3cf34641e6476045d25ce89972ac2263c3f6c1aef82d21ac52f916073c342e4c5759e7df2d49b9a8bf2781294be5f5d4289e28e3d09c4644fcc4
data/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@ Version History
2
2
  ====
3
3
  * All Version bumps are required to update this file as well!!
4
4
  ----
5
+ * 21.0.0 Add browser id api, Add datalists, Removing old data apis, Removing old coverletters version,remove old resume list, expanding the types of exceptions that can be returned
5
6
  * 20.6.0 Add new saved jobs API (/consumer/saved-jobs)
6
7
  * 20.5.0 Adding resume insights client
7
8
  * 20.4.0 Add posting_date to recommendations for job model.
@@ -1,4 +1,4 @@
1
- # Copyright 2015 CareerBuilder, LLC
1
+ # Copyright 2016 CareerBuilder, LLC
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
@@ -8,14 +8,14 @@
8
8
  # distributed under the License is distributed on an "AS IS" BASIS,
9
9
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
10
  # See the License for the specific language governing permissions and limitations under the License.
11
- require_relative 'data_list_base'
12
-
11
+ require_relative 'base'
13
12
  module Cb
14
- module Requests
15
- module DataLists
16
- class DesiredJobType < DataListBase
17
- def api_uri
18
- Cb.configuration.uri_desired_job_type
13
+ module Clients
14
+ class BrowserID < Base
15
+ class << self
16
+ # https://careerbuilder.readme.io/docs/consumerbrowser-id
17
+ def get(args={})
18
+ cb_client.cb_get(Cb.configuration.uri_browser_id, headers: headers(args))
19
19
  end
20
20
  end
21
21
  end
@@ -0,0 +1,40 @@
1
+ # Copyright 2016 CareerBuilder, LLC
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and limitations under the License.
11
+ require_relative 'base'
12
+ module Cb
13
+ module Clients
14
+ class DataList < Base
15
+ class << self
16
+ # https://careerbuilder.readme.io/docs/consumerdatalistcountries
17
+ def get(args={})
18
+ uri = "#{ Cb.configuration.uri_data_list }/#{ args[:list] }"
19
+ cb_client.cb_get(uri, headers: headers(args), query: query_strings(args))
20
+ end
21
+
22
+ private
23
+
24
+ def query_strings(args)
25
+ qs = {}
26
+ qs[:countrycode] = args[:country_code] if args[:country_code]
27
+ qs
28
+ end
29
+
30
+ def headers(args)
31
+ {
32
+ 'Accept' => 'application/json;version=2.0',
33
+ 'Authorization' => "Bearer #{ args[:oauth_token] }",
34
+ 'Content-Type' => 'application/json'
35
+ }
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
data/lib/cb/config.rb CHANGED
@@ -57,28 +57,17 @@ module Cb
57
57
  @uri_anon_saved_search_delete ||= '/v1/anonymoussavedjobsearch/delete'
58
58
  @uri_application ||= '/cbapi/application/:did'
59
59
  @uri_application_create ||= '/cbapi/application/'
60
- @uri_application_submit ||= '/v1/Application/submit'
61
- @uri_application_registered ||= '/v3/application/registered'
62
60
  @uri_application_external ||= '/v1/application/external'
63
61
  @uri_application_form ||= '/cbapi/job/:did/applicationform'
62
+ @uri_browser_id ||= '/consumer/browser-id'
64
63
  @uri_company_find ||= '/Employer/CompanyDetails'
65
- @uri_countries ||= '/consumer/datalist/countries'
66
64
  @uri_cover_letters ||= '/consumer/coverletters'
67
- @uri_cover_letter_list ||= '/v1/coverletter/list'
68
- @uri_cover_letter_retrieve ||= '/coverletter/retrieve'
69
- @uri_cover_letter_update ||= '/coverletter/edit'
70
- @uri_cover_letter_delete ||= '/coverletter/delete'
71
- @uri_desired_job_type ||= '/consumer/datalist/desiredjobtype'
72
- @uri_education_code ||= '/v1/EducationCodes'
73
- @uri_employee_types ||= '/v1/employeetypes'
65
+ @uri_data_list ||= '/consumer/datalist'
74
66
  @uri_job_branding ||= '/branding'
75
- @uri_job_category_search ||= '/v1/categories'
76
67
  @uri_job_find ||= '/v3/Job'
77
- @uri_job_industry_search ||= '/v1/industrycodes'
78
68
  @uri_job_insights ||= '/consumer/job-insights'
79
69
  @uri_job_search ||= '/consumer/jobs/search/'
80
70
  @uri_keyword_insights ||= '/consumer/insights/keywords'
81
- @uri_languages ||= '/consumer/datalist/languages'
82
71
  @uri_recommendation_for_job ||= '/v1/Recommendations/ForJob'
83
72
  @uri_recommendation_for_user ||= '/v1/Recommendations/ForUser'
84
73
  @uri_recommendation_for_company ||= '/Employer/JobRecommendation'
@@ -88,9 +77,6 @@ module Cb
88
77
  @uri_resume_put ||= '/cbapi/resumes/:resume_hash'
89
78
  @uri_resume_delete ||= '/cbapi/resumes/:resume_hash'
90
79
  @uri_resume_post ||= '/consumer/resumedocuments'
91
- @uri_resume_list ||= '/v3/resume/list'
92
- @uri_resume_language_codes ||= '/v1/languagecodes'
93
- @uri_resume_education ||= '/consumer/datalist/ResumeEducation'
94
80
  @uri_resumes ||= '/consumer/resumes'
95
81
  @uri_saved_search_retrieve ||= '/cbapi/savedsearches/:did'
96
82
  @uri_saved_search_create ||= '/v2/savedsearch/create'
@@ -101,7 +87,6 @@ module Cb
101
87
  @uri_subscription_modify ||= '/v2/user/subscription'
102
88
  @uri_saved_job ||= '/consumer/saved-jobs'
103
89
  @uri_saved_job_search_create ||= '/v2/savedsearch/create'
104
- @uri_state_list ||= '/ajax/citysuggest.aspx'
105
90
  @uri_tn_join_questions ||= '/talentnetwork/config/join/questions'
106
91
  @uri_tn_job_info ||= '/talentnetwork/internal/job'
107
92
  @uri_tn_join_form_geo ||= '/tn/JoinForm/Geo'
@@ -112,7 +97,6 @@ module Cb
112
97
  @uri_user_retrieve ||= '/v2/user/retrieve'
113
98
  @uri_user_check_existing ||= '/v2/user/checkexisting'
114
99
  @uri_user_temp_password ||= '/v1/user/temporarypassword'
115
- @uri_work_status_list ||= '/v1/resume/workstatuslist'
116
100
  end
117
101
 
118
102
  def set_attr_accessors
@@ -27,8 +27,8 @@ module Cb
27
27
  Cb::Clients::ApplicationExternal
28
28
  end
29
29
 
30
- def category
31
- Cb::Clients::Category
30
+ def browser_id
31
+ Cb::Clients::BrowserID
32
32
  end
33
33
 
34
34
  def country
@@ -43,22 +43,14 @@ module Cb
43
43
  Cb::Clients::CoverLetters
44
44
  end
45
45
 
46
- def education_code
47
- Cb::Clients::Education
46
+ def data_list
47
+ Cb::Clients::DataList
48
48
  end
49
49
 
50
50
  def email_subscription
51
51
  Cb::Clients::EmailSubscription
52
52
  end
53
53
 
54
- def employee_types
55
- Cb::Clients::EmployeeTypes
56
- end
57
-
58
- def industry
59
- Cb::Clients::Industry
60
- end
61
-
62
54
  def job
63
55
  Cb::Clients::Job
64
56
  end
@@ -75,10 +67,6 @@ module Cb
75
67
  Cb::Clients::JobInsights
76
68
  end
77
69
 
78
- def language_codes
79
- Cb::Clients::LanguageCodes
80
- end
81
-
82
70
  def recommendation
83
71
  Cb::Clients::Recommendation
84
72
  end
data/lib/cb/exceptions.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2015 CareerBuilder, LLC
1
+ # Copyright 2016 CareerBuilder, LLC
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
@@ -11,7 +11,12 @@
11
11
  module Cb
12
12
  class IncomingParamIsWrongTypeException < StandardError; end
13
13
  class ExpectedResponseFieldMissing < StandardError; end
14
- class ApiResponseError < StandardError; end
14
+ class ApiResponseError < StandardError
15
+ attr_accessor :raw_response, :response, :code
16
+ end
15
17
  class ServiceUnavailableError < ApiResponseError; end
16
18
  class UnauthorizedError < ApiResponseError; end
19
+ class DocumentNotFoundError < ApiResponseError; end
20
+ class BadRequestError < ApiResponseError; end
21
+ class ServerError < ApiResponseError; end
17
22
  end
@@ -40,22 +40,12 @@ module Cb
40
40
 
41
41
  Cb::Requests::ApplicationExternal::SubmitApplication => Cb::Responses::ApplicationExternal::SubmitApplication,
42
42
 
43
- Cb::Requests::Category::Search => Cb::Responses::Category::Search,
44
-
45
43
  Cb::Requests::Company::Find => Cb::Responses::Company::Find,
46
44
 
47
- Cb::Requests::CoverLetter::List => Cb::Responses::CoverLetter::List,
48
- Cb::Requests::CoverLetter::Retrieve => Cb::Responses::CoverLetter::Retrieve,
49
- Cb::Requests::CoverLetter::Update => Cb::Responses::CoverLetter::Update,
50
- Cb::Requests::CoverLetter::Delete => Cb::Responses::CoverLetter::Delete,
51
-
52
- Cb::Requests::Education::Get => Cb::Responses::Education::Get,
53
-
54
45
  Cb::Requests::EmailSubscription::Retrieve => Cb::Responses::EmailSubscription::Response,
55
46
  Cb::Requests::EmailSubscription::Modify => Cb::Responses::EmailSubscription::Response,
56
47
 
57
48
  Cb::Requests::Job::Report => Cb::Responses::Job::Report,
58
-
59
49
  Cb::Requests::JobSearch::Get => Cb::Responses::Job::Search,
60
50
 
61
51
  Cb::Requests::Recommendations::Resume => Cb::Responses::Recommendations,
@@ -64,17 +54,12 @@ module Cb
64
54
  Cb::Requests::Resumes::Put => Cb::Responses::Resume,
65
55
  Cb::Requests::Resumes::Delete => Cb::Responses::Resume,
66
56
  Cb::Requests::Resumes::Post => Cb::Responses::ResumeDocument,
67
- Cb::Requests::Resumes::List => Cb::Responses::ResumeList,
68
- Cb::Requests::Resumes::LanguageCodes => Cb::Responses::LanguageCodes,
69
57
 
70
58
  Cb::Requests::User::ChangePassword => Cb::Responses::User::ChangePassword,
71
59
  Cb::Requests::User::CheckExisting => Cb::Responses::User::CheckExisting,
72
60
  Cb::Requests::User::Delete => Cb::Responses::User::Delete,
73
61
  Cb::Requests::User::Retrieve => Cb::Responses::User::Retrieve,
74
- Cb::Requests::User::TemporaryPassword => Cb::Responses::User::TemporaryPassword,
75
-
76
- Cb::Requests::WorkStatus::List => Cb::Responses::WorkStatus::List,
77
- Cb::Requests::State::Get => Cb::Responses::State
62
+ Cb::Requests::User::TemporaryPassword => Cb::Responses::User::TemporaryPassword
78
63
  }.merge response_hash_extension
79
64
  end
80
65
  end
@@ -23,8 +23,19 @@ module Cb
23
23
 
24
24
  def raise_response_code_errors(response)
25
25
  code = response.code rescue nil
26
- fail Cb::ServiceUnavailableError if code == 503 || simulate_auth_outage?
27
- fail Cb::UnauthorizedError if code == 401
26
+ fail_with_error_details(response, Cb::ServiceUnavailableError) if code == 503 || simulate_auth_outage?
27
+ fail_with_error_details(response, Cb::UnauthorizedError) if [401, 403].include?(code)
28
+ fail_with_error_details(response, Cb::DocumentNotFoundError) if code == 404
29
+ fail_with_error_details(response, Cb::BadRequestError) if code && code >= 400 && code < 500
30
+ fail_with_error_details(response, Cb::ServerError) if code && code >= 500
31
+ end
32
+
33
+ def fail_with_error_details(response, error_type)
34
+ error = error_type.new
35
+ error.code = response.code rescue nil
36
+ error.raw_response = response
37
+ error.response = process_response_body(response)
38
+ fail error
28
39
  end
29
40
 
30
41
  def simulate_auth_outage?
data/lib/cb/version.rb CHANGED
@@ -9,5 +9,5 @@
9
9
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
10
  # See the License for the specific language governing permissions and limitations under the License.
11
11
  module Cb
12
- VERSION = '20.6.0'
12
+ VERSION = '21.0.0.pre1'
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 20.6.0
4
+ version: 21.0.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The CareerBuilder.com Niche and Consumer Development teams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-30 00:00:00.000000000 Z
11
+ date: 2016-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -214,12 +214,10 @@ files:
214
214
  - lib/cb/clients/application.rb
215
215
  - lib/cb/clients/application_external.rb
216
216
  - lib/cb/clients/base.rb
217
- - lib/cb/clients/category.rb
217
+ - lib/cb/clients/browser_id.rb
218
218
  - lib/cb/clients/company.rb
219
219
  - lib/cb/clients/cover_letters.rb
220
- - lib/cb/clients/education.rb
221
- - lib/cb/clients/employee_types.rb
222
- - lib/cb/clients/industry.rb
220
+ - lib/cb/clients/data_list.rb
223
221
  - lib/cb/clients/job.rb
224
222
  - lib/cb/clients/job_branding.rb
225
223
  - lib/cb/clients/job_insights.rb
@@ -264,14 +262,8 @@ files:
264
262
  - lib/cb/models/implementations/branding/styles/job_details.rb
265
263
  - lib/cb/models/implementations/branding/styles/page.rb
266
264
  - lib/cb/models/implementations/branding/widget.rb
267
- - lib/cb/models/implementations/category.rb
268
265
  - lib/cb/models/implementations/company.rb
269
- - lib/cb/models/implementations/cover_letter.rb
270
- - lib/cb/models/implementations/data_lists/resume_data_list.rb
271
- - lib/cb/models/implementations/education.rb
272
266
  - lib/cb/models/implementations/email_subscription.rb
273
- - lib/cb/models/implementations/employee_type.rb
274
- - lib/cb/models/implementations/industry.rb
275
267
  - lib/cb/models/implementations/job.rb
276
268
  - lib/cb/models/implementations/job_branding.rb
277
269
  - lib/cb/models/implementations/job_results.rb
@@ -292,7 +284,6 @@ files:
292
284
  - lib/cb/models/implementations/state.rb
293
285
  - lib/cb/models/implementations/talent_network.rb
294
286
  - lib/cb/models/implementations/user.rb
295
- - lib/cb/models/implementations/work_status.rb
296
287
  - lib/cb/requests/anonymous_saved_search/create.rb
297
288
  - lib/cb/requests/anonymous_saved_search/delete.rb
298
289
  - lib/cb/requests/application/create.rb
@@ -302,19 +293,7 @@ files:
302
293
  - lib/cb/requests/application/utils.rb
303
294
  - lib/cb/requests/application_external/submit_application.rb
304
295
  - lib/cb/requests/base.rb
305
- - lib/cb/requests/category/search.rb
306
296
  - lib/cb/requests/company/find.rb
307
- - lib/cb/requests/cover_letter/delete.rb
308
- - lib/cb/requests/cover_letter/list.rb
309
- - lib/cb/requests/cover_letter/retrieve.rb
310
- - lib/cb/requests/cover_letter/update.rb
311
- - lib/cb/requests/data_lists/countries.rb
312
- - lib/cb/requests/data_lists/data_list_base.rb
313
- - lib/cb/requests/data_lists/desired_job_type.rb
314
- - lib/cb/requests/data_lists/education_codes.rb
315
- - lib/cb/requests/data_lists/languages.rb
316
- - lib/cb/requests/data_lists/state.rb
317
- - lib/cb/requests/education/get.rb
318
297
  - lib/cb/requests/email_subscription/modify.rb
319
298
  - lib/cb/requests/email_subscription/retrieve.rb
320
299
  - lib/cb/requests/job/report.rb
@@ -322,8 +301,6 @@ files:
322
301
  - lib/cb/requests/recommendations/resume_recs.rb
323
302
  - lib/cb/requests/resumes/delete.rb
324
303
  - lib/cb/requests/resumes/get.rb
325
- - lib/cb/requests/resumes/language_codes.rb
326
- - lib/cb/requests/resumes/list.rb
327
304
  - lib/cb/requests/resumes/post.rb
328
305
  - lib/cb/requests/resumes/put.rb
329
306
  - lib/cb/requests/user/change_password.rb
@@ -331,7 +308,6 @@ files:
331
308
  - lib/cb/requests/user/delete.rb
332
309
  - lib/cb/requests/user/retrieve.rb
333
310
  - lib/cb/requests/user/temporary_password.rb
334
- - lib/cb/requests/work_status/list.rb
335
311
  - lib/cb/responses/Recommendation/recommendations.rb
336
312
  - lib/cb/responses/anonymous_saved_search/create.rb
337
313
  - lib/cb/responses/anonymous_saved_search/delete.rb
@@ -339,29 +315,16 @@ files:
339
315
  - lib/cb/responses/application.rb
340
316
  - lib/cb/responses/application/application_form.rb
341
317
  - lib/cb/responses/application_external/submit_application.rb
342
- - lib/cb/responses/category/search.rb
343
318
  - lib/cb/responses/company/find.rb
344
- - lib/cb/responses/cover_letter/delete.rb
345
- - lib/cb/responses/cover_letter/list.rb
346
- - lib/cb/responses/cover_letter/retrieve.rb
347
- - lib/cb/responses/cover_letter/status.rb
348
- - lib/cb/responses/cover_letter/update.rb
349
- - lib/cb/responses/data_list/state.rb
350
- - lib/cb/responses/data_lists/resume_data_list.rb
351
- - lib/cb/responses/education/get.rb
352
319
  - lib/cb/responses/email_subscription/response.rb
353
- - lib/cb/responses/employee_types/search.rb
354
320
  - lib/cb/responses/errors.rb
355
- - lib/cb/responses/industry/search.rb
356
321
  - lib/cb/responses/job/report.rb
357
322
  - lib/cb/responses/job/search.rb
358
323
  - lib/cb/responses/job/singular.rb
359
324
  - lib/cb/responses/metadata.rb
360
325
  - lib/cb/responses/nil_model.rb
361
- - lib/cb/responses/resumes/language_codes.rb
362
326
  - lib/cb/responses/resumes/resume.rb
363
327
  - lib/cb/responses/resumes/resume_document.rb
364
- - lib/cb/responses/resumes/resume_list.rb
365
328
  - lib/cb/responses/saved_search/delete.rb
366
329
  - lib/cb/responses/saved_search/list.rb
367
330
  - lib/cb/responses/saved_search/retrieve.rb
@@ -373,7 +336,6 @@ files:
373
336
  - lib/cb/responses/user/delete.rb
374
337
  - lib/cb/responses/user/retrieve.rb
375
338
  - lib/cb/responses/user/temporary_password.rb
376
- - lib/cb/responses/work_status/list.rb
377
339
  - lib/cb/utils/api.rb
378
340
  - lib/cb/utils/console_observer.rb
379
341
  - lib/cb/utils/country.rb
@@ -401,9 +363,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
401
363
  version: '0'
402
364
  required_rubygems_version: !ruby/object:Gem::Requirement
403
365
  requirements:
404
- - - '>='
366
+ - - '>'
405
367
  - !ruby/object:Gem::Version
406
- version: '0'
368
+ version: 1.3.1
407
369
  requirements: []
408
370
  rubyforge_project:
409
371
  rubygems_version: 2.4.8
@@ -1,55 +0,0 @@
1
- # Copyright 2015 CareerBuilder, LLC
2
- # Licensed under the Apache License, Version 2.0 (the "License");
3
- # you may not use this file except in compliance with the License.
4
- # You may obtain a copy of the License at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- # Unless required by applicable law or agreed to in writing, software
8
- # distributed under the License is distributed on an "AS IS" BASIS,
9
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- # See the License for the specific language governing permissions and limitations under the License.
11
- require 'json'
12
- require_relative 'base'
13
- module Cb
14
- module Clients
15
- class Category < Base
16
- def self.search
17
- json_hash = cb_client.cb_get(Cb.configuration.uri_job_category_search)
18
- categoryList = []
19
-
20
- if json_hash.key?('ResponseCategories')
21
- if json_hash['ResponseCategories'].key?('Categories')
22
- json_hash['ResponseCategories']['Categories']['Category'].each do |cat|
23
- categoryList << Models::Category.new(cat)
24
- end
25
- end
26
-
27
- cb_client.append_api_responses(categoryList, json_hash['ResponseCategories'])
28
- end
29
-
30
- cb_client.append_api_responses(categoryList, json_hash)
31
- end
32
-
33
- def self.search_by_host_site(host_site)
34
- json_hash = cb_client.cb_get(Cb.configuration.uri_job_category_search, query: { CountryCode: host_site })
35
- categoryList = []
36
-
37
- if json_hash.key?('ResponseCategories')
38
- if json_hash['ResponseCategories'].key?('Categories')
39
- if json_hash['ResponseCategories']['Categories']['Category'].is_a?(Array)
40
- json_hash['ResponseCategories']['Categories']['Category'].each do |cat|
41
- categoryList << Models::Category.new(cat)
42
- end
43
- elsif json_hash['ResponseCategories']['Categories']['Category'].is_a?(Hash) && json_hash.length < 2
44
- categoryList << Models::Category.new(json_hash['ResponseCategories']['Categories']['Category'])
45
- end
46
- end
47
-
48
- cb_client.append_api_responses(categoryList, json_hash['ResponseCategories'])
49
- end
50
-
51
- cb_client.append_api_responses(categoryList, json_hash)
52
- end
53
- end
54
- end
55
- end