cb-api 11.2.2 → 11.3.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -71,6 +71,11 @@ module Cb
|
|
71
71
|
my_api.append_api_responses(jobs, json_hash)
|
72
72
|
end
|
73
73
|
|
74
|
+
def self.for_resume(oauth_token, resume_hash)
|
75
|
+
json_hash = oauth_token.get(Cb.configuration.uri_recommendation_for_resume, :query => {:resume_hash => resume_hash})
|
76
|
+
Responses::Recommendations.new(json_hash)
|
77
|
+
end
|
78
|
+
|
74
79
|
private
|
75
80
|
|
76
81
|
def self.normalize_args(args)
|
@@ -99,6 +104,7 @@ module Cb
|
|
99
104
|
|
100
105
|
jobs
|
101
106
|
end
|
107
|
+
|
102
108
|
end
|
103
109
|
end
|
104
110
|
end
|
data/lib/cb/config.rb
CHANGED
@@ -52,6 +52,7 @@ module Cb
|
|
52
52
|
@uri_recommendation_for_job ||= '/v1/Recommendations/ForJob'
|
53
53
|
@uri_recommendation_for_user ||= '/v1/Recommendations/ForUser'
|
54
54
|
@uri_recommendation_for_company ||= '/Employer/JobRecommendation'
|
55
|
+
@uri_recommendation_for_resume ||= '/consumer/jobsearch/recommendations/:resume_hash'
|
55
56
|
@uri_application ||= '/cbapi/application/:did'
|
56
57
|
@uri_application_create ||= '/cbapi/application/'
|
57
58
|
@uri_application_submit ||= '/v1/Application/submit'
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Cb
|
2
|
+
module Models
|
3
|
+
class RecommendedJob < ApiResponseModel
|
4
|
+
attr_reader :id, :job_title, :city, :admin_area_1, :latitude,
|
5
|
+
:longitude, :company_name, :company_id, :job_details_url,
|
6
|
+
:employment_type, :educations_required, :experience_required,
|
7
|
+
:matcher_id, :pay, :categories, :apply_requirements,
|
8
|
+
:skills, :posted
|
9
|
+
|
10
|
+
def required_fields
|
11
|
+
[id, job_title]
|
12
|
+
end
|
13
|
+
|
14
|
+
def set_model_properties
|
15
|
+
args = api_response
|
16
|
+
@id = args['id']
|
17
|
+
@job_title = args['job_title']
|
18
|
+
@city = args['city']
|
19
|
+
@admin_area_1 = args['admin_area_1']
|
20
|
+
@latitude = args['latitude']
|
21
|
+
@longitude = args['longitude']
|
22
|
+
@company_name = args['company_name']
|
23
|
+
@company_id = args['company_id']
|
24
|
+
@job_details_url = args['job_details_url']
|
25
|
+
@employment_type = args['employment_type']
|
26
|
+
@educations_required = args['educations_required']
|
27
|
+
@experience_required = args['experience_required']
|
28
|
+
@matcher_id = args['matcher_id']
|
29
|
+
@pay = args['pay']
|
30
|
+
@categories = args['categories']
|
31
|
+
@apply_requirements = args['apply_requirements']
|
32
|
+
@skills = args['skills']
|
33
|
+
@posted = args['posted']
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Cb
|
2
|
+
module Responses
|
3
|
+
class Recommendations < ApiResponse
|
4
|
+
|
5
|
+
def validate_api_hash
|
6
|
+
required_response_field(root_node, response)
|
7
|
+
required_response_field('results', response[root_node])
|
8
|
+
end
|
9
|
+
|
10
|
+
def hash_containing_metadata
|
11
|
+
response[root_node]
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
def extract_models
|
16
|
+
response[root_node]['results'].map { |cur_job| Models::RecommendedJob.new(cur_job) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def root_node
|
20
|
+
'data'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
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: 11.
|
4
|
+
version: 11.3.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-08-
|
12
|
+
date: 2014-08-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -236,6 +236,7 @@ files:
|
|
236
236
|
- lib/cb/responses/application/application_form.rb
|
237
237
|
- lib/cb/responses/spot/retrieve_response.rb
|
238
238
|
- lib/cb/responses/email_subscription/response.rb
|
239
|
+
- lib/cb/responses/Recommendation/recommendations.rb
|
239
240
|
- lib/cb/responses/industry/search.rb
|
240
241
|
- lib/cb/responses/api_response.rb
|
241
242
|
- lib/cb/responses/user/check_existing.rb
|
@@ -291,6 +292,7 @@ files:
|
|
291
292
|
- lib/cb/models/implementations/work_status.rb
|
292
293
|
- lib/cb/models/implementations/category.rb
|
293
294
|
- lib/cb/models/implementations/talent_network.rb
|
295
|
+
- lib/cb/models/implementations/recommended_job.rb
|
294
296
|
- lib/cb/models/implementations/spot.rb
|
295
297
|
- lib/cb/models/implementations/email_subscription.rb
|
296
298
|
- lib/cb/models/implementations/collapsed_jobs.rb
|