cb-api 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/cb/clients/saved_search_api.rb +29 -15
- data/lib/cb/models/cb_saved_search.rb +32 -31
- data/lib/cb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDg4MmFkNzJiYzBhYTUwMmVmYzgzOTdhNDJiMzY5OGMzZTU1NjAwMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTgyNzFjOTMxNTNjYTdiZjIwZDQyYjY5Mzc5ODM0NDllNzQ5YWFmZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmUxNjMzY2E3OWFkMmJmYzE3MjNlMjJmOTYxY2NjYzBhNTM2MDI2YjBhNWVl
|
10
|
+
ZWE1ZGE1YzFhMzVmNzM1Yzk4ZThhYTIzY2FhMDNjZWE1YmJlNTU1MzE0MmRh
|
11
|
+
YTg1NmMwNGYyMGJhNDEwNzRmMzQzM2VhMDRmYWQzZjE1MDNlZmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjljM2RiMDZkN2U3YmM2NjcyYzMwOTU0YzNjYzE1MTlhMmVmYzhkMGY5MGU4
|
14
|
+
NzQ0M2IxMmRhYjMxYWQ0N2YyNDgzZmQ5NDMzMzY1NWZiNDc5MjRmMGNlMDU4
|
15
|
+
YTdiMGMzNzNhMjQ3ODdjOTFhYWQyYjI1MWFjZjZiODlkYzIwNjU=
|
@@ -9,12 +9,13 @@ module Cb
|
|
9
9
|
## For detailed information around this API please visit:
|
10
10
|
## http://api.careerbuilder.com/savedsearchinfo.aspx
|
11
11
|
#############################################################
|
12
|
-
def self.create
|
12
|
+
def self.create *args
|
13
|
+
args = args[0] if args.is_a?(Array) && args.count == 1
|
13
14
|
my_api = Cb::Utils::Api.new
|
14
|
-
cb_response = my_api.cb_post Cb.configuration.uri_saved_search_create, :body => CbSavedSearch.new(
|
15
|
+
cb_response = my_api.cb_post Cb.configuration.uri_saved_search_create, :body => CbSavedSearch.new(args).create_to_xml
|
15
16
|
json_hash = JSON.parse cb_response.response.body
|
16
|
-
saved_search = CbSavedSearch.new json_hash['SavedJobSearch']
|
17
|
-
my_api.append_api_responses saved_search, json_hash['SavedJobSearch']
|
17
|
+
saved_search = CbSavedSearch.new json_hash['SavedJobSearch']['SavedSearch']
|
18
|
+
my_api.append_api_responses saved_search, json_hash['SavedJobSearch']['SavedSearch']
|
18
19
|
|
19
20
|
return saved_search
|
20
21
|
end
|
@@ -25,12 +26,13 @@ module Cb
|
|
25
26
|
## For detailed information around this API please visit:
|
26
27
|
## http://api.careerbuilder.com/savedsearchinfo.aspx
|
27
28
|
#############################################################
|
28
|
-
def self.update
|
29
|
+
def self.update *args
|
30
|
+
args = args[0] if args.is_a?(Array) && args.count == 1
|
29
31
|
my_api = Cb::Utils::Api.new
|
30
|
-
cb_response = my_api.cb_post Cb.configuration.uri_saved_search_update, :body => CbSavedSearch.new(
|
32
|
+
cb_response = my_api.cb_post Cb.configuration.uri_saved_search_update, :body => CbSavedSearch.new(args).update_to_xml
|
31
33
|
json_hash = JSON.parse cb_response.response.body
|
32
|
-
saved_search = CbSavedSearch.new json_hash['SavedJobSearch']
|
33
|
-
my_api.append_api_responses saved_search, json_hash['SavedJobSearch']
|
34
|
+
saved_search = CbSavedSearch.new json_hash['SavedJobSearch']['SavedSearch']
|
35
|
+
my_api.append_api_responses saved_search, json_hash['SavedJobSearch']['SavedSearch']
|
34
36
|
|
35
37
|
return saved_search
|
36
38
|
end
|
@@ -42,9 +44,10 @@ module Cb
|
|
42
44
|
## http://api.careerbuilder.com/savedsearchinfo.aspx
|
43
45
|
#############################################################
|
44
46
|
|
45
|
-
def self.delete
|
47
|
+
def self.delete *args
|
48
|
+
args = args[0] if args.is_a?(Array) && args.count == 1
|
46
49
|
my_api = Cb::Utils::Api.new
|
47
|
-
cb_response = my_api.cb_post Cb.configuration.uri_saved_search_delete, :body=>CbSavedSearch.new(
|
50
|
+
cb_response = my_api.cb_post Cb.configuration.uri_saved_search_delete, :body=>CbSavedSearch.new(args).delete_to_xml
|
48
51
|
json_hash = JSON.parse cb_response.response.body
|
49
52
|
saved_search = CbSavedSearch.new json_hash
|
50
53
|
my_api.append_api_responses saved_search, json_hash
|
@@ -70,8 +73,8 @@ module Cb
|
|
70
73
|
my_api = Cb::Utils::Api.new
|
71
74
|
cb_response = my_api.cb_get Cb.configuration.uri_saved_search_retrieve, :query => {:developerkey=> developer_key, :externaluserid=> external_user_id, :externalid=> external_id, :hostsite=> host_site}
|
72
75
|
json_hash = JSON.parse cb_response.response.body
|
73
|
-
saved_search = CbSavedSearch.new json_hash['SavedJobSearch']
|
74
|
-
my_api.append_api_responses saved_search, json_hash['SavedJobSearch']
|
76
|
+
saved_search = CbSavedSearch.new json_hash['SavedJobSearch']['SavedSearch']
|
77
|
+
my_api.append_api_responses saved_search, json_hash['SavedJobSearch']['SavedSearch']
|
75
78
|
|
76
79
|
return saved_search
|
77
80
|
end
|
@@ -86,10 +89,21 @@ module Cb
|
|
86
89
|
my_api = Cb::Utils::Api.new
|
87
90
|
cb_response = my_api.cb_get Cb.configuration.uri_saved_search_list, :query => {:developerkey=>developer_key, :ExternalUserId=>external_user_id}
|
88
91
|
json_hash = JSON.parse cb_response.response.body
|
89
|
-
saved_search = CbSavedSearch.new json_hash['SavedJobSearches']
|
90
|
-
my_api.append_api_responses saved_search, json_hash['SavedJobSearches']
|
91
92
|
|
92
|
-
|
93
|
+
saved_searches = []
|
94
|
+
unless json_hash.empty?
|
95
|
+
if json_hash['SavedJobSearches']['SavedSearches']['SavedSearch'].is_a?(Array)
|
96
|
+
json_hash['SavedJobSearches']['SavedSearches']['SavedSearch'].each do |saved_search|
|
97
|
+
saved_searches << CbSavedSearch.new(saved_search)
|
98
|
+
end
|
99
|
+
elsif json_hash['SavedJobSearches']['SavedSearches']['SavedSearch'].is_a?(Hash) && json_hash.length < 2
|
100
|
+
saved_searches << CbSavedSearch.new(json_hash['SavedJobSearches']['SavedSearches']['SavedSearch'])
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
my_api.append_api_responses saved_searches, json_hash['SavedJobSearches']
|
105
|
+
|
106
|
+
return saved_searches
|
93
107
|
end
|
94
108
|
|
95
109
|
end
|
@@ -5,39 +5,40 @@ module Cb
|
|
5
5
|
:emp_type, :exclude_company_names, :exclude_job_titles, :exclude_national, :industry_codes,
|
6
6
|
:keywords, :order_by, :order_direction, :radius, :pay_high, :pay_low, :posted_within,
|
7
7
|
:pay_info_only, :location, :job_category, :company, :city, :state, :is_daily_email, :external_id,
|
8
|
-
:external_user_id, :dev_key
|
8
|
+
:external_user_id, :dev_key, :jrdid
|
9
9
|
|
10
10
|
def initialize(args={})
|
11
|
-
@hostsite = args[
|
12
|
-
@cobrand = args[
|
13
|
-
@search_name = args[
|
14
|
-
@site_id = args[
|
15
|
-
@boolean_operator = args[
|
16
|
-
@category = args[
|
17
|
-
@education_code = args[
|
18
|
-
@specific_education = args[
|
19
|
-
@emp_type = args[
|
20
|
-
@exclude_company_names = args[
|
21
|
-
@exclude_job_titles = args[
|
22
|
-
@exclude_national = args[
|
23
|
-
@industry_codes = args[
|
24
|
-
@keywords = args[
|
25
|
-
@order_by = args[
|
26
|
-
@order_direction = args[
|
27
|
-
@radius = args[
|
28
|
-
@pay_high = args[
|
29
|
-
@pay_low = args[
|
30
|
-
@posted_within = args[
|
31
|
-
@pay_info_only = args[
|
32
|
-
@location = args[
|
33
|
-
@job_category = args[
|
34
|
-
@company = args[
|
35
|
-
@city = args[
|
36
|
-
@state = args[
|
37
|
-
@is_daily_email = args[
|
38
|
-
@external_id = args[
|
39
|
-
@external_user_id = args[
|
40
|
-
@dev_key = args[
|
11
|
+
@hostsite = args['HostSite'] || ''
|
12
|
+
@cobrand = args['Cobrand'] || ''
|
13
|
+
@search_name = args['SearchName'] || ''
|
14
|
+
@site_id = args['SiteId'] || ''
|
15
|
+
@boolean_operator = args['BooleanOperator'] || ''
|
16
|
+
@category = args['Category'] || ''
|
17
|
+
@education_code = args['EducationCode'] || ''
|
18
|
+
@specific_education = args['SpecificEducation'] || false
|
19
|
+
@emp_type = args['EmpType'] || ''
|
20
|
+
@exclude_company_names = args['ExcludeCompanyNames'] || ''
|
21
|
+
@exclude_job_titles = args['ExcludeJobTitles'] || ''
|
22
|
+
@exclude_national = args['ExcludeNational'] || false
|
23
|
+
@industry_codes = args['IndustryCodes'] || ''
|
24
|
+
@keywords = args['Keywords'] || ''
|
25
|
+
@order_by = args['OrderBy'] || ''
|
26
|
+
@order_direction = args['OrderDirection'] || ''
|
27
|
+
@radius = args['Radius'] || 30
|
28
|
+
@pay_high = args['PayHigh'] || 0
|
29
|
+
@pay_low = args['PayLow'] || 0
|
30
|
+
@posted_within = args['PostedWithin'] || 30
|
31
|
+
@pay_info_only = args['PayInfoOnly'] || false
|
32
|
+
@location = args['Location'] || ''
|
33
|
+
@job_category = args['JobCategory'] || ''
|
34
|
+
@company = args['Company'] || ''
|
35
|
+
@city = args['City'] || ''
|
36
|
+
@state = args['State'] || ''
|
37
|
+
@is_daily_email = args['IsDailyEmail'] || ''
|
38
|
+
@external_id = args['ExternalID'] || ''
|
39
|
+
@external_user_id = args['ExternalUserID'] || ''
|
40
|
+
@dev_key = args['DeveloperKey'] || ''
|
41
|
+
@jrdid = args['JRDID'] || ''
|
41
42
|
end
|
42
43
|
|
43
44
|
def create_to_xml
|
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: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Retchko
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-08-01 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: httparty
|