cb-api 12.0.3 → 12.1.0

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.
data/lib/cb/config.rb CHANGED
@@ -82,6 +82,7 @@ module Cb
82
82
  @uri_saved_job_search_create ||= '/v2/savedsearch/create'
83
83
  @uri_spot_retrieve ||= '/v2/spot/load'
84
84
  @uri_work_status_list ||= '/v1/resume/workstatuslist'
85
+ @uri_resume_get ||= '/cbapi/resumes/:resume_hash'
85
86
  end
86
87
 
87
88
  def set_attr_accessors
@@ -0,0 +1,22 @@
1
+ module Cb
2
+ module Criteria
3
+ module Resumes
4
+ class GetByHash
5
+ extend Cb::Utils::FluidAttributes
6
+
7
+ fluid_attr_accessor :resume_hash, :external_user_id
8
+
9
+ def initialize(args = {})
10
+ @resume_hash = args[:resumeHash] || ''
11
+ @external_user_id = args[:externalUserID] || ''
12
+ end
13
+
14
+ def to_hash
15
+ { :resume_hash => @resume_hash, :external_user_id => @external_user_id }
16
+ end
17
+
18
+ alias :to_h :to_hash
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,69 @@
1
+ module Cb
2
+ module Models
3
+ class Resume < ApiResponseModel
4
+ attr_accessor :desired_job_title, :user_identifier, :resume_hash, :privacy_setting, :work_experience, :salary_information,
5
+ :educations, :skills_and_qualifications, :relocations, :government_and_military
6
+
7
+ def set_model_properties
8
+ @desired_job_title = api_response['desiredJobTitle']
9
+ @user_identifier = api_response['userIdentifier']
10
+ @resume_hash = api_response['resumeHash']
11
+ @privacy_setting = api_response['privacySetting']
12
+ @work_experience = extract_work_experience
13
+ @salary_information = extract_salary_information
14
+ @educations = extract_educations
15
+ @skills_and_qualifications = extract_skills_and_qualifications
16
+ @relocations = extract_relocations
17
+ @government_and_military = extract_government_and_military
18
+
19
+ end
20
+
21
+ def required_fields
22
+ ['userIdentifier']
23
+ end
24
+
25
+ private
26
+ def extract_work_experience
27
+ unless api_response['workExperience'].nil?
28
+ api_response['workExperience'].collect do |experience|
29
+ Resumes::WorkExperience.new(experience)
30
+ end
31
+ end
32
+ end
33
+
34
+ def extract_salary_information
35
+ unless api_response['salaryInformation'].nil?
36
+ Resumes::SalaryInformation.new(api_response['salaryInformation'])
37
+ end
38
+ end
39
+
40
+ def extract_educations
41
+ unless api_response['educations'].nil?
42
+ api_response['educations'].collect do |education|
43
+ Resumes::Education.new(education)
44
+ end
45
+ end
46
+ end
47
+
48
+ def extract_skills_and_qualifications
49
+ unless api_response['skillsAndQualifications'].nil?
50
+ Resumes::SkillsAndQualifications.new(api_response['skillsAndQualifications'])
51
+ end
52
+ end
53
+
54
+ def extract_relocations
55
+ unless api_response['relocations'].nil?
56
+ api_response['relocations'].collect do |relocation|
57
+ Resumes::Relocation.new(relocation)
58
+ end
59
+ end
60
+ end
61
+
62
+ def extract_government_and_military
63
+ unless api_response['governmentAndMilitary'].nil?
64
+ Resumes::GovernmentAndMilitary.new(api_response['governmentAndMilitary'])
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,20 @@
1
+ module Cb
2
+ module Models
3
+ module Resumes
4
+ class Education < ApiResponseModel
5
+ attr_accessor :school_name, :major_or_program, :degree, :graduation_date
6
+
7
+ def set_model_properties
8
+ @school_name = api_response['schoolName']
9
+ @major_or_program = api_response['majorOrProgram']
10
+ @degree = api_response['degree']
11
+ @graduation_date = api_response['graduationDate']
12
+ end
13
+
14
+ def required_fields
15
+ ['schoolName', 'majorOrProgram']
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ module Cb
2
+ module Models
3
+ module Resumes
4
+ class GovernmentAndMilitary < ApiResponseModel
5
+ attr_accessor :has_security_clearance, :military_experience
6
+
7
+ def set_model_properties
8
+ @has_security_clearance = api_response['hasSecurityClearance']
9
+ @military_experience = api_response['militaryExperience']
10
+ end
11
+
12
+ def required_fields
13
+ ['hasSecurityClearance', 'militaryExperience']
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ module Cb
2
+ module Models
3
+ module Resumes
4
+ class Relocation < ApiResponseModel
5
+ attr_accessor :city, :admin_area, :country_code
6
+
7
+ def set_model_properties
8
+ @city = api_response['city']
9
+ @admin_area = api_response['adminArea']
10
+ @country_code = api_response['countryCode']
11
+ end
12
+
13
+ def required_fields
14
+ ['city', 'adminArea', 'countryCode']
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,23 @@
1
+ module Cb
2
+ module Models
3
+ module Resumes
4
+ class SalaryInformation < ApiResponseModel
5
+ attr_accessor :most_recent_pay_amount, :per_hour_or_per_year, :currency_code,
6
+ :job_title, :annual_bonus, :annual_commission
7
+
8
+ def set_model_properties
9
+ @most_recent_pay_amount = api_response['mostRecentPayAmount']
10
+ @per_hour_or_per_year = api_response['PerHourOrPerYear']
11
+ @currency_code = api_response['CurrencyCode']
12
+ @job_title = api_response['jobTitle']
13
+ @annual_bonus = api_response['annualBonus']
14
+ @annual_commission = api_response['annualCommission']
15
+ end
16
+
17
+ def required_fields
18
+ ['PerHourOrPerYear', 'mostRecentPayAmount']
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,29 @@
1
+ module Cb
2
+ module Models
3
+ module Resumes
4
+ class SkillsAndQualifications < ApiResponseModel
5
+ attr_accessor :accreditations_and_certifications, :languages_spoken,
6
+ :has_management_experience, :size_of_team_managed
7
+
8
+ def set_model_properties
9
+ @accreditations_and_certifications = api_response['accreditationsAndCertifications']
10
+ @languages_spoken = extract_languages_spoken
11
+ @has_management_experience = api_response['hasManagementExperience']
12
+ @size_of_team_managed = api_response['sizeOfTeamManaged']
13
+ end
14
+
15
+ def required_fields
16
+ []
17
+ end
18
+
19
+ def extract_languages_spoken
20
+ unless api_response['languagesSpoken'].nil?
21
+ api_response['languagesSpoken'].collect do |language|
22
+ language
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,23 @@
1
+ module Cb
2
+ module Models
3
+ module Resumes
4
+ class WorkExperience < ApiResponseModel
5
+ attr_accessor :job_title, :company_name, :employment_type, :start_date, :end_date,
6
+ :currently_employed_here
7
+
8
+ def set_model_properties
9
+ @job_title = api_response['jobTitle']
10
+ @company_name = api_response['companyName']
11
+ @employment_type = api_response['employmentType']
12
+ @start_date = api_response['startDate']
13
+ @end_date = api_response['endDate']
14
+ @currently_employed_here = api_response['currentlyEmployedHere']
15
+ end
16
+
17
+ def required_fields
18
+ ['jobTitle', 'currentlyEmployedHere']
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,31 @@
1
+ require_relative '../base'
2
+
3
+ module Cb
4
+ module Requests
5
+ module Resumes
6
+ class Get < Base
7
+ def endpoint_uri
8
+ Cb.configuration.uri_resume_get.gsub(':resume_hash', args[:resume_hash].to_s)
9
+ end
10
+
11
+ def http_method
12
+ :get
13
+ end
14
+
15
+ def query
16
+ {
17
+ externalUserID: args[:external_user_id]
18
+ }
19
+ end
20
+
21
+ def headers
22
+ {
23
+ 'DeveloperKey' => Cb.configuration.dev_key,
24
+ 'HostSite' => Cb.configuration.host_site,
25
+ 'Content-Type' => 'application/json'
26
+ }
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,24 @@
1
+ module Cb
2
+ module Responses
3
+ module Resumes
4
+ class Get < ApiResponse
5
+ def validate_api_hash
6
+ required_response_field(root_node, response)
7
+ end
8
+
9
+ def extract_models
10
+ response[root_node].map { |resume| Models::Resume.new(resume) }
11
+ end
12
+
13
+ def hash_containing_metadata
14
+ response
15
+ end
16
+
17
+ def root_node
18
+ 'Results'
19
+ end
20
+
21
+ end
22
+ end
23
+ end
24
+ end
@@ -20,6 +20,8 @@ module Cb
20
20
 
21
21
  def response_hash
22
22
  {
23
+ Cb::Requests::Resumes::Get => Cb::Responses::Resumes::Get,
24
+
23
25
  Cb::Requests::AnonymousSavedSearch::Create => Cb::Responses::AnonymousSavedSearch::Create,
24
26
  Cb::Requests::AnonymousSavedSearch::Delete => Cb::Responses::AnonymousSavedSearch::Delete,
25
27
 
data/lib/cb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '12.0.3'
2
+ VERSION = '12.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.3
4
+ version: 12.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-02 00:00:00.000000000 Z
12
+ date: 2014-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -227,6 +227,7 @@ files:
227
227
  - lib/cb/criteria/spot/retrieve.rb
228
228
  - lib/cb/criteria/user/delete.rb
229
229
  - lib/cb/criteria/user/change_password.rb
230
+ - lib/cb/criteria/resumes/get_by_hash.rb
230
231
  - lib/cb/responses/anonymous_saved_search/delete.rb
231
232
  - lib/cb/responses/anonymous_saved_search/create.rb
232
233
  - lib/cb/responses/application.rb
@@ -256,12 +257,14 @@ files:
256
257
  - lib/cb/responses/employee_types/search.rb
257
258
  - lib/cb/responses/errors.rb
258
259
  - lib/cb/responses/company/find.rb
260
+ - lib/cb/responses/resumes/get.rb
259
261
  - lib/cb/responses/education/get.rb
260
262
  - lib/cb/exceptions.rb
261
263
  - lib/cb/config.rb
262
264
  - lib/cb/models/api_response_model.rb
263
265
  - lib/cb/models/implementations/job_branding.rb
264
266
  - lib/cb/models/implementations/application.rb
267
+ - lib/cb/models/implementations/resume.rb
265
268
  - lib/cb/models/implementations/application/resume.rb
266
269
  - lib/cb/models/implementations/application/form.rb
267
270
  - lib/cb/models/implementations/application/cover_letter.rb
@@ -295,6 +298,12 @@ files:
295
298
  - lib/cb/models/implementations/recommended_job.rb
296
299
  - lib/cb/models/implementations/spot.rb
297
300
  - lib/cb/models/implementations/email_subscription.rb
301
+ - lib/cb/models/implementations/resumes/relocation.rb
302
+ - lib/cb/models/implementations/resumes/salary_information.rb
303
+ - lib/cb/models/implementations/resumes/education.rb
304
+ - lib/cb/models/implementations/resumes/skills_and_qualifications.rb
305
+ - lib/cb/models/implementations/resumes/work_experience.rb
306
+ - lib/cb/models/implementations/resumes/government_and_military.rb
298
307
  - lib/cb/models/implementations/collapsed_jobs.rb
299
308
  - lib/cb/models/api_call_model.rb
300
309
  - lib/cb/requests/anonymous_saved_search/delete.rb
@@ -316,6 +325,7 @@ files:
316
325
  - lib/cb/requests/category/search.rb
317
326
  - lib/cb/requests/application_external/submit_application.rb
318
327
  - lib/cb/requests/company/find.rb
328
+ - lib/cb/requests/resumes/get.rb
319
329
  - lib/cb/requests/education/get.rb
320
330
  - lib/cb/convenience.rb
321
331
  - lib/cb/clients/job_branding.rb