cb-api 17.4.0 → 18.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/CONTRIBUTING.md +18 -0
- data/LICENSE +202 -0
- data/README.md +3 -1
- data/lib/cb.rb +12 -2
- data/lib/cb/client.rb +10 -0
- data/lib/cb/clients/anon_saved_search.rb +12 -4
- data/lib/cb/clients/application.rb +10 -2
- data/lib/cb/clients/application_external.rb +13 -5
- data/lib/cb/clients/category.rb +16 -8
- data/lib/cb/clients/company.rb +16 -8
- data/lib/cb/clients/education.rb +17 -9
- data/lib/cb/clients/employee_types.rb +11 -3
- data/lib/cb/clients/industry.rb +12 -3
- data/lib/cb/clients/job.rb +10 -2
- data/lib/cb/clients/job_branding.rb +13 -5
- data/lib/cb/clients/recommendation.rb +27 -18
- data/lib/cb/clients/saved_search.rb +21 -15
- data/lib/cb/clients/talent_network.rb +20 -12
- data/lib/cb/clients/user.rb +22 -14
- data/lib/cb/config.rb +64 -54
- data/lib/cb/convenience.rb +22 -13
- data/lib/cb/criteria/application/cover_letter.rb +10 -0
- data/lib/cb/criteria/application/create.rb +11 -1
- data/lib/cb/criteria/application/get.rb +10 -0
- data/lib/cb/criteria/application/response.rb +10 -0
- data/lib/cb/criteria/application/resume.rb +10 -0
- data/lib/cb/criteria/application/update.rb +10 -0
- data/lib/cb/criteria/job/details.rb +11 -1
- data/lib/cb/criteria/resumes/get_by_hash.rb +12 -2
- data/lib/cb/criteria/user/change_password.rb +21 -11
- data/lib/cb/criteria/user/delete.rb +18 -11
- data/lib/cb/exceptions.rb +14 -4
- data/lib/cb/models/api_call_model.rb +10 -1
- data/lib/cb/models/api_response_model.rb +15 -7
- data/lib/cb/models/implementations/application.rb +10 -1
- data/lib/cb/models/implementations/application/cover_letter.rb +10 -1
- data/lib/cb/models/implementations/application/form.rb +13 -5
- data/lib/cb/models/implementations/application/response.rb +10 -1
- data/lib/cb/models/implementations/application/resume.rb +10 -1
- data/lib/cb/models/implementations/application_external.rb +12 -3
- data/lib/cb/models/implementations/branding/media.rb +10 -2
- data/lib/cb/models/implementations/branding/section.rb +10 -2
- data/lib/cb/models/implementations/branding/style.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/base.rb +12 -4
- data/lib/cb/models/implementations/branding/styles/buttons.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/company_info.rb +11 -3
- data/lib/cb/models/implementations/branding/styles/container.rb +11 -3
- data/lib/cb/models/implementations/branding/styles/content.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/css_adapter.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/headings.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/job_details.rb +10 -2
- data/lib/cb/models/implementations/branding/styles/page.rb +10 -2
- data/lib/cb/models/implementations/branding/widget.rb +10 -2
- data/lib/cb/models/implementations/category.rb +17 -7
- data/lib/cb/models/implementations/collapsed_job_results.rb +10 -1
- data/lib/cb/models/implementations/collapsed_jobs.rb +10 -0
- data/lib/cb/models/implementations/company.rb +17 -10
- data/lib/cb/models/implementations/data_lists/resume_data_list.rb +11 -1
- data/lib/cb/models/implementations/education.rb +10 -0
- data/lib/cb/models/implementations/email_subscription.rb +10 -0
- data/lib/cb/models/implementations/employee_type.rb +14 -4
- data/lib/cb/models/implementations/industry.rb +14 -6
- data/lib/cb/models/implementations/job.rb +24 -20
- data/lib/cb/models/implementations/job_branding.rb +13 -5
- data/lib/cb/models/implementations/job_results.rb +10 -2
- data/lib/cb/models/implementations/job_results_v3.rb +11 -1
- data/lib/cb/models/implementations/recommended_job.rb +10 -0
- data/lib/cb/models/implementations/resume.rb +11 -1
- data/lib/cb/models/implementations/resume_document.rb +10 -0
- data/lib/cb/models/implementations/resume_listing.rb +11 -1
- data/lib/cb/models/implementations/resumes/country_code.rb +10 -0
- data/lib/cb/models/implementations/resumes/education.rb +11 -1
- data/lib/cb/models/implementations/resumes/government_and_military.rb +11 -1
- data/lib/cb/models/implementations/resumes/language_code.rb +12 -2
- data/lib/cb/models/implementations/resumes/relocation.rb +11 -1
- data/lib/cb/models/implementations/resumes/salary_information.rb +11 -2
- data/lib/cb/models/implementations/resumes/skills_and_qualifications.rb +10 -0
- data/lib/cb/models/implementations/resumes/work_experience.rb +11 -1
- data/lib/cb/models/implementations/saved_search.rb +83 -73
- data/lib/cb/models/implementations/state.rb +11 -2
- data/lib/cb/models/implementations/talent_network.rb +44 -36
- data/lib/cb/models/implementations/user.rb +12 -2
- data/lib/cb/models/implementations/work_status.rb +12 -3
- data/lib/cb/requests/anonymous_saved_search/create.rb +10 -2
- data/lib/cb/requests/anonymous_saved_search/delete.rb +10 -2
- data/lib/cb/requests/application/create.rb +10 -1
- data/lib/cb/requests/application/form.rb +10 -2
- data/lib/cb/requests/application/get.rb +10 -1
- data/lib/cb/requests/application/update.rb +10 -1
- data/lib/cb/requests/application/utils.rb +10 -1
- data/lib/cb/requests/application_external/submit_application.rb +10 -2
- data/lib/cb/requests/base.rb +13 -5
- data/lib/cb/requests/category/search.rb +10 -2
- data/lib/cb/requests/company/find.rb +12 -4
- data/lib/cb/requests/data_lists/countries.rb +10 -0
- data/lib/cb/requests/data_lists/data_list_base.rb +11 -1
- data/lib/cb/requests/data_lists/desired_job_type.rb +10 -0
- data/lib/cb/requests/data_lists/education_codes.rb +10 -0
- data/lib/cb/requests/data_lists/languages.rb +10 -0
- data/lib/cb/requests/data_lists/state.rb +12 -2
- data/lib/cb/requests/education/get.rb +10 -2
- data/lib/cb/requests/email_subscription/modify.rb +13 -5
- data/lib/cb/requests/email_subscription/retrieve.rb +10 -2
- data/lib/cb/requests/job_search/get.rb +12 -3
- data/lib/cb/requests/recommendations/resume_recs.rb +12 -4
- data/lib/cb/requests/resumes/delete.rb +10 -0
- data/lib/cb/requests/resumes/get.rb +10 -0
- data/lib/cb/requests/resumes/language_codes.rb +12 -2
- data/lib/cb/requests/resumes/list.rb +12 -2
- data/lib/cb/requests/resumes/post.rb +11 -1
- data/lib/cb/requests/resumes/put.rb +11 -3
- data/lib/cb/requests/user/change_password.rb +10 -2
- data/lib/cb/requests/user/check_existing.rb +10 -2
- data/lib/cb/requests/user/delete.rb +10 -2
- data/lib/cb/requests/user/retrieve.rb +10 -2
- data/lib/cb/requests/user/temporary_password.rb +11 -3
- data/lib/cb/requests/work_status/list.rb +10 -2
- data/lib/cb/responses/Recommendation/recommendations.rb +10 -1
- data/lib/cb/responses/anonymous_saved_search/create.rb +10 -2
- data/lib/cb/responses/anonymous_saved_search/delete.rb +10 -2
- data/lib/cb/responses/api_response.rb +19 -9
- data/lib/cb/responses/application.rb +10 -2
- data/lib/cb/responses/application/application_form.rb +10 -2
- data/lib/cb/responses/application_external/submit_application.rb +11 -2
- data/lib/cb/responses/category/search.rb +13 -4
- data/lib/cb/responses/company/find.rb +12 -3
- data/lib/cb/responses/data_list/state.rb +10 -1
- data/lib/cb/responses/data_lists/resume_data_list.rb +10 -1
- data/lib/cb/responses/education/get.rb +13 -4
- data/lib/cb/responses/email_subscription/response.rb +11 -2
- data/lib/cb/responses/employee_types/search.rb +10 -3
- data/lib/cb/responses/errors.rb +14 -5
- data/lib/cb/responses/industry/search.rb +11 -4
- data/lib/cb/responses/job/search.rb +10 -1
- data/lib/cb/responses/job/search_v3.rb +10 -1
- data/lib/cb/responses/job/singular.rb +13 -4
- data/lib/cb/responses/metadata.rb +11 -2
- data/lib/cb/responses/resumes/language_codes.rb +11 -0
- data/lib/cb/responses/resumes/resume.rb +10 -1
- data/lib/cb/responses/resumes/resume_document.rb +10 -0
- data/lib/cb/responses/resumes/resume_list.rb +10 -0
- data/lib/cb/responses/saved_search/delete.rb +11 -3
- data/lib/cb/responses/saved_search/list.rb +10 -2
- data/lib/cb/responses/saved_search/retrieve.rb +10 -2
- data/lib/cb/responses/saved_search/singular.rb +10 -2
- data/lib/cb/responses/saved_search/update.rb +11 -3
- data/lib/cb/responses/timing.rb +15 -6
- data/lib/cb/responses/user/change_password.rb +12 -4
- data/lib/cb/responses/user/check_existing.rb +11 -3
- data/lib/cb/responses/user/delete.rb +11 -3
- data/lib/cb/responses/user/retrieve.rb +10 -3
- data/lib/cb/responses/user/temporary_password.rb +10 -3
- data/lib/cb/responses/work_status/list.rb +12 -4
- data/lib/cb/utils/api.rb +22 -12
- data/lib/cb/utils/console_observer.rb +11 -2
- data/lib/cb/utils/country.rb +14 -4
- data/lib/cb/utils/fluid_attributes.rb +11 -4
- data/lib/cb/utils/meta_values.rb +10 -0
- data/lib/cb/utils/response_array_extractor.rb +14 -6
- data/lib/cb/utils/response_map.rb +12 -3
- data/lib/cb/utils/validator.rb +21 -19
- data/lib/cb/version.rb +11 -1
- data/lib/tasks/cb.rake +11 -1
- data/lib/tasks/doc.rake +15 -5
- metadata +5 -3
@@ -1,3 +1,13 @@
|
|
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.
|
1
11
|
module Cb
|
2
12
|
module Models
|
3
13
|
class SavedSearch
|
@@ -8,21 +18,21 @@ module Cb
|
|
8
18
|
:external_user_id, :job_search_url, :jrdid, :errors, :browser_id, :session_id, :test, :email_address,
|
9
19
|
:country, :search_parameters, :did, :user_oauth_token, :email_delivery_day
|
10
20
|
|
11
|
-
def initialize(args={})
|
12
|
-
@host_site = args['HostSite']
|
13
|
-
@cobrand = args['Cobrand']
|
14
|
-
@search_name = args['SearchName']
|
15
|
-
@site_id = args['SiteId']
|
16
|
-
@is_daily_email = args['IsDailyEmail']
|
17
|
-
@email_delivery_day = args['EmailDeliveryDay'] || args[:email_delivery_day]
|
18
|
-
@job_search_url = args['JobSearchUrl']
|
19
|
-
@external_id = args['ExternalID']
|
20
|
-
@external_user_id = args['ExternalUserID']
|
21
|
-
@browser_id = args['BrowserID']
|
22
|
-
@session_id = args['SessionID']
|
23
|
-
@email_address = args['EmailAddress']
|
24
|
-
@did = args['DID']
|
25
|
-
@user_oauth_token = args['userOAuthToken']
|
21
|
+
def initialize(args = {})
|
22
|
+
@host_site = args['HostSite'] || args[:host_site] || ''
|
23
|
+
@cobrand = args['Cobrand'] || args[:cobrand] || ''
|
24
|
+
@search_name = args['SearchName'] || args[:search_name] || ''
|
25
|
+
@site_id = args['SiteId'] || args[:site_id] || ''
|
26
|
+
@is_daily_email = args['IsDailyEmail'] || args[:is_daily_email] || false
|
27
|
+
@email_delivery_day = args['EmailDeliveryDay'] || args[:email_delivery_day] || ''
|
28
|
+
@job_search_url = args['JobSearchUrl'] || args[:job_search_url] || ''
|
29
|
+
@external_id = args['ExternalID'] || args[:external_id] || ''
|
30
|
+
@external_user_id = args['ExternalUserID'] || args[:external_user_id] || ''
|
31
|
+
@browser_id = args['BrowserID'] || args[:browser_id] || nil
|
32
|
+
@session_id = args['SessionID'] || args[:session_id] || ''
|
33
|
+
@email_address = args['EmailAddress'] || args[:email_address] || ''
|
34
|
+
@did = args['DID'] || args[:did] || ''
|
35
|
+
@user_oauth_token = args['userOAuthToken'] || args[:user_oauth_token] || ''
|
26
36
|
@search_parameters = SearchParameters.new(args['SavedSearchParameters'] || {})
|
27
37
|
end
|
28
38
|
|
@@ -59,18 +69,19 @@ module Cb
|
|
59
69
|
|
60
70
|
def update_to_json
|
61
71
|
hash = {
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
72
|
+
'DID' => did,
|
73
|
+
'SearchName' => search_name,
|
74
|
+
'HostSite' => host_site,
|
75
|
+
'SiteID' => site_id,
|
76
|
+
'Cobrand' => cobrand,
|
77
|
+
'IsDailyEmail' => is_daily_email,
|
78
|
+
'userOAuthToken' => user_oauth_token,
|
79
|
+
'SavedSearchParameters' => search_parameters.to_hash
|
70
80
|
}
|
71
|
-
hash[
|
81
|
+
hash['EmailDeliveryDay'] = email_delivery_day unless is_daily_email
|
72
82
|
hash.to_json
|
73
83
|
end
|
84
|
+
|
74
85
|
def delete_anon_to_xml
|
75
86
|
<<-eos
|
76
87
|
<Request>
|
@@ -97,35 +108,35 @@ module Cb
|
|
97
108
|
:jc_position_level, :jc_location, :jc_advertiser_flags, :jc_job_nature
|
98
109
|
|
99
110
|
def initialize(args = {})
|
100
|
-
@boolean_operator = args['BooleanOperator']
|
101
|
-
@category = args['Category']
|
102
|
-
@job_category = args['JobCategory']
|
103
|
-
@education_code = args['EducationCode']
|
104
|
-
@emp_type = args['EmpType']
|
105
|
-
@exclude_company_names = args['ExcludeCompanyNames'] ||
|
106
|
-
@exclude_job_titles = args['ExcludeJobTitles']
|
107
|
-
@exclude_keywords = args['ExcludeKeywords']
|
108
|
-
@exclude_national = args['ExcludeNational'].nil?
|
109
|
-
@industry_codes = args['IndustryCodes']
|
110
|
-
@job_title = args['JobTitle']
|
111
|
-
@keywords = args['Keywords']
|
112
|
-
@location = args['Location']
|
113
|
-
@order_by = args['OrderBy']
|
114
|
-
@order_direction = args['OrderDirection']
|
115
|
-
@pay_high = args['PayHigh']
|
116
|
-
@pay_low = args['PayLow']
|
117
|
-
@pay_info_only = args['PayInfoOnly'].nil?
|
118
|
-
@posted_within = args['PostedWithin']
|
119
|
-
@radius = args['Radius']
|
111
|
+
@boolean_operator = args['BooleanOperator'] || ''
|
112
|
+
@category = args['Category'] || ''
|
113
|
+
@job_category = args['JobCategory'] || ''
|
114
|
+
@education_code = args['EducationCode'] || ''
|
115
|
+
@emp_type = args['EmpType'] || ''
|
116
|
+
@exclude_company_names = args['ExcludeCompanyNames'] || ''
|
117
|
+
@exclude_job_titles = args['ExcludeJobTitles'] || ''
|
118
|
+
@exclude_keywords = args['ExcludeKeywords'] || ''
|
119
|
+
@exclude_national = args['ExcludeNational'].nil? ? false : args['ExcludeNational']
|
120
|
+
@industry_codes = args['IndustryCodes'] || ''
|
121
|
+
@job_title = args['JobTitle'] || ''
|
122
|
+
@keywords = args['Keywords'] || ''
|
123
|
+
@location = args['Location'] || ''
|
124
|
+
@order_by = args['OrderBy'] || ''
|
125
|
+
@order_direction = args['OrderDirection'] || ''
|
126
|
+
@pay_high = args['PayHigh'] || 0
|
127
|
+
@pay_low = args['PayLow'] || 0
|
128
|
+
@pay_info_only = args['PayInfoOnly'].nil? ? false : args['PayInfoOnly']
|
129
|
+
@posted_within = args['PostedWithin'] || 30
|
130
|
+
@radius = args['Radius'] || 30
|
120
131
|
@specific_education = args['SpecificEducation'].nil? ? false : args['SpecificEducation']
|
121
|
-
@city = args['City']
|
122
|
-
@state = args['State']
|
123
|
-
@country = args['Country']
|
124
|
-
@company = args['Company']
|
125
|
-
@jc_position_level = args['JCPositionLevel']
|
126
|
-
@jc_location = args['JCLocation']
|
127
|
-
@jc_advertiser_flags = args['JCAdvertiserFlags']
|
128
|
-
@jc_job_nature = args['JCJobNature']
|
132
|
+
@city = args['City'] || ''
|
133
|
+
@state = args['State'] || ''
|
134
|
+
@country = args['Country'] || ''
|
135
|
+
@company = args['Company'] || ''
|
136
|
+
@jc_position_level = args['JCPositionLevel'] || ''
|
137
|
+
@jc_location = args['JCLocation'] || ''
|
138
|
+
@jc_advertiser_flags = args['JCAdvertiserFlags'] || ''
|
139
|
+
@jc_job_nature = args['JCJobNature'] || ''
|
129
140
|
end
|
130
141
|
|
131
142
|
def to_xml
|
@@ -158,30 +169,29 @@ module Cb
|
|
158
169
|
|
159
170
|
def to_hash
|
160
171
|
{
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
172
|
+
'BooleanOperator' => boolean_operator,
|
173
|
+
'JobCategory' => job_category,
|
174
|
+
'EducationCode' => education_code,
|
175
|
+
'EmpType' => emp_type,
|
176
|
+
'ExcludeCompanyNames' => exclude_company_names,
|
177
|
+
'ExcludeJobTitles' => exclude_job_titles,
|
178
|
+
'Country' => country,
|
179
|
+
'IndustryCodes' => industry_codes,
|
180
|
+
'JobTitle' => job_title,
|
181
|
+
'Keywords' => keywords,
|
182
|
+
'Location' => location,
|
183
|
+
'OrderBy' => order_by,
|
184
|
+
'OrderDirection' => order_direction,
|
185
|
+
'PayHigh' => pay_high,
|
186
|
+
'PayLow' => pay_low,
|
187
|
+
'PostedWithin' => posted_within,
|
188
|
+
'Radius' => radius,
|
189
|
+
'SpecificEducation' => specific_education,
|
190
|
+
'ExcludeNational' => exclude_national,
|
191
|
+
'PayInfoOnly' => pay_info_only
|
181
192
|
}
|
182
193
|
end
|
183
194
|
end
|
184
195
|
end
|
185
|
-
|
186
196
|
end
|
187
197
|
end
|
@@ -1,3 +1,13 @@
|
|
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.
|
1
11
|
module Cb
|
2
12
|
module Models
|
3
13
|
class State < ApiResponseModel
|
@@ -6,11 +16,10 @@ module Cb
|
|
6
16
|
def set_model_properties
|
7
17
|
@key = api_response['StateId']
|
8
18
|
@value = api_response['StateName']
|
9
|
-
|
10
19
|
end
|
11
20
|
|
12
21
|
def required_fields
|
13
|
-
|
22
|
+
%w(StateId StateName)
|
14
23
|
end
|
15
24
|
end
|
16
25
|
end
|
@@ -1,10 +1,20 @@
|
|
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.
|
1
11
|
module Cb
|
2
12
|
module Models
|
3
13
|
class TalentNetwork
|
4
14
|
attr_accessor :join_form_questions
|
5
|
-
def initialize(args={})
|
6
|
-
@join_form_questions =
|
7
|
-
if args.
|
15
|
+
def initialize(args = {})
|
16
|
+
@join_form_questions = []
|
17
|
+
if args.key?('JoinQuestions')
|
8
18
|
args['JoinQuestions'].each do |question|
|
9
19
|
@join_form_questions << TalentNetwork::Questions.new(question)
|
10
20
|
end
|
@@ -16,48 +26,47 @@ module Cb
|
|
16
26
|
attr_accessor :dev_key, :tn_did, :preferred_language, :accept_privacy, :accept_terms, :resume_word_doc,
|
17
27
|
:join_values
|
18
28
|
|
19
|
-
def initialize(args={})
|
29
|
+
def initialize(args = {})
|
20
30
|
@dev_key = args['DeveloperKey'] || Cb.configuration.dev_key
|
21
31
|
@tn_did = args['TNDID'] || ''
|
22
32
|
@preferred_language = args['PreferredLanguage'] || 'USEnglish'
|
23
33
|
@accept_privacy = args['AcceptPrivacy'] || true
|
24
34
|
@accept_terms = args['AcceptTerms'] || true
|
25
35
|
@resume_word_doc = args['ResumeWordDoc'] || ''
|
26
|
-
@join_values = args['JoinValues'] ||
|
36
|
+
@join_values = args['JoinValues'] || []
|
27
37
|
end
|
28
38
|
|
29
39
|
def to_xml
|
30
|
-
ret =
|
40
|
+
ret = '<Request>'
|
31
41
|
ret += "<DeveloperKey>#{@dev_key}</DeveloperKey>"
|
32
42
|
ret += "<TalentNetworkDID>#{@tn_did}</TalentNetworkDID>"
|
33
43
|
ret += "<PreferredLanguage>#{@preferred_language}</PreferredLanguage>"
|
34
44
|
ret += "<AcceptPrivacy>#{@accept_privacy}</AcceptPrivacy>"
|
35
45
|
ret += "<AcceptTerms>#{@accept_terms}</AcceptTerms>"
|
36
46
|
ret += "<ResumeWordDoc>#{@resume_word_doc}</ResumeWordDoc>"
|
37
|
-
ret +=
|
38
|
-
@join_values.each
|
39
|
-
ret +=
|
47
|
+
ret += '<JoinValues>'
|
48
|
+
@join_values.each do |k, v|
|
49
|
+
ret += '<JoinValue>'
|
40
50
|
ret += "<Key>#{k}</Key>"
|
41
51
|
ret += "<Value>#{v}</Value>"
|
42
|
-
ret +=
|
43
|
-
|
44
|
-
ret +=
|
45
|
-
ret +=
|
52
|
+
ret += '</JoinValue>'
|
53
|
+
end
|
54
|
+
ret += '</JoinValues>'
|
55
|
+
ret += '</Request>'
|
46
56
|
end
|
47
57
|
end
|
48
58
|
|
49
|
-
|
50
59
|
class TalentNetwork::Questions
|
51
60
|
attr_accessor :text, :form_value, :option_display_type, :order, :required, :options
|
52
61
|
|
53
|
-
def initialize(args={})
|
62
|
+
def initialize(args = {})
|
54
63
|
@text = args['Text'] || ''
|
55
64
|
@form_value = args['FormValue'] || ''
|
56
65
|
@option_display_type = args['OptionDisplayType'] || ''
|
57
66
|
@order = args['Order'] || ''
|
58
67
|
@required = args['Required'].to_s || ''
|
59
|
-
@options =
|
60
|
-
if args.
|
68
|
+
@options = []
|
69
|
+
if args.key?('Options')
|
61
70
|
args['Options'].each do |option_values|
|
62
71
|
@options << TalentNetwork::Options.new(option_values)
|
63
72
|
end
|
@@ -68,7 +77,7 @@ module Cb
|
|
68
77
|
class TalentNetwork::Options
|
69
78
|
attr_accessor :value, :order, :display_text
|
70
79
|
|
71
|
-
def initialize(args={})
|
80
|
+
def initialize(args = {})
|
72
81
|
@value = args['Value'] || ''
|
73
82
|
@order = args['Order'] || ''
|
74
83
|
@display_text = args['DisplayText'] || ''
|
@@ -78,7 +87,7 @@ module Cb
|
|
78
87
|
class TalentNetwork::JobInfo
|
79
88
|
attr_accessor :join_form_url, :tn_did, :join_form_intercept_enabled
|
80
89
|
|
81
|
-
def initialize(args={})
|
90
|
+
def initialize(args = {})
|
82
91
|
@join_form_url = args['JoinFormUrl'] || ''
|
83
92
|
@tn_did = args['sTNDID'] || ''
|
84
93
|
@join_form_intercept_enabled = args['JoinFormInterceptEnabled'].to_s || ''
|
@@ -88,52 +97,52 @@ module Cb
|
|
88
97
|
class TalentNetwork::JoinFormGeo
|
89
98
|
attr_accessor :countries, :states
|
90
99
|
|
91
|
-
def initialize(args={})
|
92
|
-
@countries =
|
93
|
-
@states =
|
100
|
+
def initialize(args = {})
|
101
|
+
@countries = {}
|
102
|
+
@states = {}
|
94
103
|
|
95
|
-
if args.
|
104
|
+
if args.key?('Countries')
|
96
105
|
@countries = TalentNetwork::JoinFormGeoLocation.new(args['Countries'])
|
97
106
|
end
|
98
107
|
|
99
|
-
if args.
|
108
|
+
if args.key?('States')
|
100
109
|
@states = TalentNetwork::JoinFormGeoLocation.new(args['States'])
|
101
110
|
end
|
102
|
-
|
103
111
|
end
|
104
112
|
end
|
105
113
|
|
106
114
|
class TalentNetwork::JoinFormGeoLocation
|
107
115
|
attr_accessor :geo_hash
|
108
116
|
|
109
|
-
def initialize(args={})
|
110
|
-
value =
|
111
|
-
display_val =
|
112
|
-
@geo_hash =
|
117
|
+
def initialize(args = {})
|
118
|
+
value = []
|
119
|
+
display_val = []
|
120
|
+
@geo_hash = {}
|
113
121
|
|
114
|
-
if args.
|
122
|
+
if args.key?('Value')
|
115
123
|
args['Value'].each do |val|
|
116
124
|
value << val
|
117
125
|
end
|
118
126
|
end
|
119
127
|
|
120
|
-
if args.
|
128
|
+
if args.key?('Display')
|
121
129
|
args['Display'].each do |display|
|
122
130
|
display_val << display
|
123
131
|
end
|
124
132
|
end
|
125
133
|
|
126
134
|
unless value.nil? || display_val.nil?
|
127
|
-
@geo_hash = convert_to_hash(display_val,value)
|
135
|
+
@geo_hash = convert_to_hash(display_val, value)
|
128
136
|
end
|
129
137
|
end
|
130
138
|
|
131
139
|
private
|
140
|
+
|
132
141
|
def convert_to_hash(keys, values)
|
133
|
-
geo_hash =
|
142
|
+
geo_hash = {}
|
134
143
|
geo_hash = Hash[keys.zip(values)]
|
135
144
|
|
136
|
-
|
145
|
+
geo_hash
|
137
146
|
end
|
138
147
|
end
|
139
148
|
|
@@ -141,7 +150,7 @@ module Cb
|
|
141
150
|
attr_accessor :stylesheet_url, :join_logo_image_url, :join_custom_msg_html, :button_color,
|
142
151
|
:mobile_logo_image_url, :nav_color, :site_path
|
143
152
|
|
144
|
-
def initialize(args={})
|
153
|
+
def initialize(args = {})
|
145
154
|
@stylesheet_url = args['StylesheetURL'] || ''
|
146
155
|
@join_logo_image_url = args['JoinLogoImageURL'] || ''
|
147
156
|
@join_custom_msg_html = args['JoinCustomMsgHTML'] || ''
|
@@ -151,6 +160,5 @@ module Cb
|
|
151
160
|
@site_path = args['SitePath'] || ''
|
152
161
|
end
|
153
162
|
end
|
154
|
-
|
155
163
|
end
|
156
164
|
end
|
@@ -1,3 +1,13 @@
|
|
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.
|
1
11
|
module Cb
|
2
12
|
module Models
|
3
13
|
class User
|
@@ -41,7 +51,7 @@ module Cb
|
|
41
51
|
@work_status = args['WorkStatus'] || ''
|
42
52
|
end
|
43
53
|
|
44
|
-
def custom_value
|
54
|
+
def custom_value(custom_value_key)
|
45
55
|
custom_value = nil
|
46
56
|
|
47
57
|
if @custom_values['CustomValue'].is_a? Array
|
@@ -52,7 +62,7 @@ module Cb
|
|
52
62
|
custom_value = @custom_values['CustomValue']['Value'] if @custom_values['CustomValue']['Key'] == custom_value_key
|
53
63
|
end
|
54
64
|
|
55
|
-
|
65
|
+
custom_value
|
56
66
|
end
|
57
67
|
end
|
58
68
|
end
|
@@ -1,3 +1,13 @@
|
|
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.
|
1
11
|
module Cb
|
2
12
|
module Models
|
3
13
|
class WorkStatus
|
@@ -6,7 +16,7 @@ module Cb
|
|
6
16
|
def initialize(args = {})
|
7
17
|
return if args.nil?
|
8
18
|
@key = args['Key'] || ''
|
9
|
-
@translations = [
|
19
|
+
@translations = [args['Description']].flatten.map { |translation| Translation.new translation }
|
10
20
|
end
|
11
21
|
|
12
22
|
class Translation
|
@@ -15,10 +25,9 @@ module Cb
|
|
15
25
|
def initialize(args = {})
|
16
26
|
return if args.nil?
|
17
27
|
@language = args['Language'] || ''
|
18
|
-
@value = args['Value']
|
28
|
+
@value = args['Value'] || ''
|
19
29
|
end
|
20
30
|
end
|
21
|
-
|
22
31
|
end
|
23
32
|
end
|
24
33
|
end
|