cb-api 12.1.0 → 12.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cb/config.rb +1 -0
- data/lib/cb/requests/resumes/put.rb +114 -0
- data/lib/cb/responses/resumes/resume.rb +22 -0
- data/lib/cb/utils/response_map.rb +2 -1
- data/lib/cb/version.rb +1 -1
- metadata +4 -3
- data/lib/cb/responses/resumes/get.rb +0 -24
data/lib/cb/config.rb
CHANGED
@@ -0,0 +1,114 @@
|
|
1
|
+
require_relative '../base'
|
2
|
+
|
3
|
+
module Cb
|
4
|
+
module Requests
|
5
|
+
module Resumes
|
6
|
+
class Put < Base
|
7
|
+
def endpoint_uri
|
8
|
+
Cb.configuration.uri_resume_put.gsub(':resume_hash', args[:resume_hash].to_s)
|
9
|
+
end
|
10
|
+
|
11
|
+
def http_method
|
12
|
+
:put
|
13
|
+
end
|
14
|
+
|
15
|
+
def headers
|
16
|
+
{
|
17
|
+
'DeveloperKey' => Cb.configuration.dev_key,
|
18
|
+
'HostSite' => Cb.configuration.host_site,
|
19
|
+
'Content-Type' => 'application/json'
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def body
|
24
|
+
{
|
25
|
+
userIdentifier: args[:user_identifier],
|
26
|
+
resumeHash: args[:resume_hash],
|
27
|
+
desiredJobTitle: args[:desired_job_title],
|
28
|
+
privacySetting: args[:privacy_setting],
|
29
|
+
workExperience: extract_work_experience,
|
30
|
+
salaryInformation: extract_salary_information,
|
31
|
+
educations: extract_educations,
|
32
|
+
skillsAndQualifications: extract_skills_and_qualifications,
|
33
|
+
relocations: extract_relocations,
|
34
|
+
governmentAndMilitary: extract_government_and_military
|
35
|
+
}.to_json
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def extract_work_experience
|
41
|
+
return [] if args[:work_experience].blank?
|
42
|
+
args[:work_experience].collect do |experience|
|
43
|
+
{
|
44
|
+
jobTitle: experience[:job_title],
|
45
|
+
companyName: experience[:company_name],
|
46
|
+
employmentType: experience[:employment_type],
|
47
|
+
startDate: experience[:start_date],
|
48
|
+
endDate: experience[:end_date],
|
49
|
+
currentlyEmployedHere: experience[:currently_employed_here]
|
50
|
+
}
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def extract_salary_information
|
55
|
+
salary = args[:salary_information]
|
56
|
+
return {} if salary.blank?
|
57
|
+
{
|
58
|
+
mostRecentPayAmount: salary[:most_recent_pay_amount],
|
59
|
+
perHourOrPerYear: salary[:per_hour_or_per_year],
|
60
|
+
currencyCode: salary[:currency_code],
|
61
|
+
jobTitle: salary[:job_title],
|
62
|
+
annualBonus: salary[:annual_bonus],
|
63
|
+
annualCommission: salary[:annual_commission],
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
def extract_educations
|
68
|
+
return [] if args[:educations].blank?
|
69
|
+
args[:educations].collect do |education|
|
70
|
+
{
|
71
|
+
schoolName: education[:school_name],
|
72
|
+
majorOrProgram: education[:major],
|
73
|
+
degreeCode: education[:degree_code],
|
74
|
+
graduationDate: education[:graduation_date]
|
75
|
+
}
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def extract_skills_and_qualifications
|
80
|
+
skills = args[:skills_and_qualifications]
|
81
|
+
return {} if skills.blank?
|
82
|
+
{
|
83
|
+
accreditationsAndCertifications: skills[:accreditations_and_certifications],
|
84
|
+
languagesSpoken: skills[:languages_spoken],
|
85
|
+
hasManagementExperience: skills[:has_management_experience],
|
86
|
+
sizeOfTeamManaged: skills[:size_of_team_managed]
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
|
91
|
+
def extract_relocations
|
92
|
+
return [] unless args[:relocations]
|
93
|
+
args[:relocations].collect do |relocate|
|
94
|
+
{
|
95
|
+
city: relocate[:city],
|
96
|
+
adminArea: relocate[:admin_area],
|
97
|
+
countryCode: relocate[:country_code]
|
98
|
+
}
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def extract_government_and_military
|
103
|
+
government = args[:government_and_military]
|
104
|
+
return {} if government.blank?
|
105
|
+
{
|
106
|
+
hasSecurityClearance: government[:has_security_clearance],
|
107
|
+
militaryExperience: government[:military_experience]
|
108
|
+
}
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Cb
|
2
|
+
module Responses
|
3
|
+
class Resume < ApiResponse
|
4
|
+
def validate_api_hash
|
5
|
+
required_response_field(root_node, response)
|
6
|
+
end
|
7
|
+
|
8
|
+
def extract_models
|
9
|
+
response[root_node].map { |resume| Models::Resume.new(resume) }
|
10
|
+
end
|
11
|
+
|
12
|
+
def hash_containing_metadata
|
13
|
+
response
|
14
|
+
end
|
15
|
+
|
16
|
+
def root_node
|
17
|
+
'Results'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -20,7 +20,8 @@ module Cb
|
|
20
20
|
|
21
21
|
def response_hash
|
22
22
|
{
|
23
|
-
Cb::Requests::Resumes::Get => Cb::Responses::
|
23
|
+
Cb::Requests::Resumes::Get => Cb::Responses::Resume,
|
24
|
+
Cb::Requests::Resumes::Put => Cb::Responses::Resume,
|
24
25
|
|
25
26
|
Cb::Requests::AnonymousSavedSearch::Create => Cb::Responses::AnonymousSavedSearch::Create,
|
26
27
|
Cb::Requests::AnonymousSavedSearch::Delete => Cb::Responses::AnonymousSavedSearch::Delete,
|
data/lib/cb/version.rb
CHANGED
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.
|
4
|
+
version: 12.2.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-
|
12
|
+
date: 2014-09-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -257,7 +257,7 @@ files:
|
|
257
257
|
- lib/cb/responses/employee_types/search.rb
|
258
258
|
- lib/cb/responses/errors.rb
|
259
259
|
- lib/cb/responses/company/find.rb
|
260
|
-
- lib/cb/responses/resumes/
|
260
|
+
- lib/cb/responses/resumes/resume.rb
|
261
261
|
- lib/cb/responses/education/get.rb
|
262
262
|
- lib/cb/exceptions.rb
|
263
263
|
- lib/cb/config.rb
|
@@ -325,6 +325,7 @@ files:
|
|
325
325
|
- lib/cb/requests/category/search.rb
|
326
326
|
- lib/cb/requests/application_external/submit_application.rb
|
327
327
|
- lib/cb/requests/company/find.rb
|
328
|
+
- lib/cb/requests/resumes/put.rb
|
328
329
|
- lib/cb/requests/resumes/get.rb
|
329
330
|
- lib/cb/requests/education/get.rb
|
330
331
|
- lib/cb/convenience.rb
|
@@ -1,24 +0,0 @@
|
|
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
|