cb-api 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cb/clients/resume_api.rb +4 -4
- data/lib/cb/models/cb_resume.rb +107 -13
- data/lib/cb/version.rb +1 -1
- metadata +13 -5
- checksums.yaml +0 -15
@@ -49,8 +49,8 @@ module Cb
|
|
49
49
|
cb_response = my_api.cb_get(Cb.configuration.uri_resume_retrieve, :query => params)
|
50
50
|
json_hash = JSON.parse(cb_response.response.body)
|
51
51
|
|
52
|
-
resume = Cb::CbResume.new json_hash
|
53
|
-
my_api.append_api_responses resume, json_hash
|
52
|
+
resume = Cb::CbResume.new json_hash['ResponseRetrieve']['Resume']
|
53
|
+
my_api.append_api_responses resume, json_hash['ResponseRetrieve']
|
54
54
|
|
55
55
|
return resume
|
56
56
|
end
|
@@ -67,8 +67,8 @@ module Cb
|
|
67
67
|
cb_response = my_api.cb_get(Cb.configuration.uri_resume_retrieve, :query => params)
|
68
68
|
json_hash = JSON.parse(cb_response.response.body)
|
69
69
|
|
70
|
-
resume = resume.set_attributes json_hash
|
71
|
-
my_api.append_api_responses resume, json_hash
|
70
|
+
resume = resume.set_attributes json_hash['ResponseRetrieve']['Resume']
|
71
|
+
my_api.append_api_responses resume, json_hash['ResponseRetrieve']
|
72
72
|
|
73
73
|
return resume
|
74
74
|
end
|
data/lib/cb/models/cb_resume.rb
CHANGED
@@ -34,7 +34,6 @@ module Cb
|
|
34
34
|
@modified_dt = args['ModifiedDT'] || ''
|
35
35
|
@categories = args['Categories'] || ''
|
36
36
|
@resume_text = args['ResumeText'] || ''
|
37
|
-
@languages = !args['Languages'].nil? ? args['Languages']['Language'] : ''
|
38
37
|
@stats_searches = !args['Stats'].nil? ? args['Stats']['Searches'] : -1
|
39
38
|
@stats_clicks = !args['Stats'].nil? ? args['Stats']['Clicks'] : -1
|
40
39
|
@stats_applications = !args['Stats'].nil? ? args['Stats']['Applications'] : -1
|
@@ -46,29 +45,50 @@ module Cb
|
|
46
45
|
@test = false
|
47
46
|
|
48
47
|
@company_experiences = []
|
49
|
-
if args.has_key?('CompanyExperiences')
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
if args.has_key?('CompanyExperiences') && !args['CompanyExperiences'].blank?
|
49
|
+
ce = args['CompanyExperiences']['CompanyExperience']
|
50
|
+
if ce.is_a? Array
|
51
|
+
ce.each do | hi |
|
52
|
+
@company_experiences << CbResume::CbCompanyExperience.new(hi)
|
53
53
|
end
|
54
|
+
elsif ce.is_a? Hash
|
55
|
+
@company_experiences << CbResume::CbCompanyExperience.new(ce)
|
54
56
|
end
|
55
57
|
end
|
56
58
|
|
57
59
|
@educations = []
|
58
|
-
if args.has_key?('Educations')
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
if args.has_key?('Educations') && !args['Educations'].blank?
|
61
|
+
ed = args['Educations']['Education']
|
62
|
+
if ed.is_a? Array
|
63
|
+
ed.each do | hello |
|
64
|
+
@educations << CbResume::CbEducation.new(hello)
|
62
65
|
end
|
66
|
+
elsif ed.is_a? Hash
|
67
|
+
@educations << CbResume::CbEducation.new(ed)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
@languages = []
|
72
|
+
if args.has_key?('Languages') && !args['Languages'].blank?
|
73
|
+
la = args['Languages']['Language']
|
74
|
+
if la.is_a? Array
|
75
|
+
la.each do | greetings |
|
76
|
+
@languages << CbResume::CbLanguage.new(greetings)
|
77
|
+
end
|
78
|
+
elsif la.is_a? String
|
79
|
+
@languages << CbResume::CbLanguage.new(la)
|
63
80
|
end
|
64
81
|
end
|
65
82
|
|
66
83
|
@custom_values = []
|
67
|
-
if args.has_key?('CustomValues')
|
68
|
-
|
69
|
-
|
70
|
-
|
84
|
+
if args.has_key?('CustomValues') && !args['CustomValues'].blank?
|
85
|
+
cv = args['CustomValues']['CustomValue']
|
86
|
+
if cv.is_a? Array
|
87
|
+
cv.each do | hola |
|
88
|
+
@custom_values << CbResume::CbCustomValue.new(hola)
|
71
89
|
end
|
90
|
+
elsif cv.is_a? Hash
|
91
|
+
@custom_values << CbResume::CbCustomValue.new(cv)
|
72
92
|
end
|
73
93
|
end
|
74
94
|
end
|
@@ -85,9 +105,75 @@ module Cb
|
|
85
105
|
@educations << CbResume::CbEducation.new(params)
|
86
106
|
end
|
87
107
|
|
108
|
+
def add_language(params)
|
109
|
+
@languages << CbResume::CbLanguage.new(params)
|
110
|
+
end
|
111
|
+
|
88
112
|
def add_custom_value(params)
|
89
113
|
@custom_values << CbResume::CbCustomValue.new(params)
|
90
114
|
end
|
115
|
+
|
116
|
+
def custom_value custom_value_key
|
117
|
+
custom_value = ""
|
118
|
+
|
119
|
+
@custom_values.each do |cv|
|
120
|
+
custom_value = cv.value if cv.key == custom_value_key
|
121
|
+
end
|
122
|
+
|
123
|
+
return custom_value
|
124
|
+
end
|
125
|
+
|
126
|
+
def current_employed
|
127
|
+
custom_value "CURR_EMPLYD"
|
128
|
+
end
|
129
|
+
|
130
|
+
def desired_job_type
|
131
|
+
custom_value "DES_JOB_TYP"
|
132
|
+
end
|
133
|
+
|
134
|
+
def experience_in_months
|
135
|
+
custom_value "EXP_MNS"
|
136
|
+
end
|
137
|
+
|
138
|
+
def job_type
|
139
|
+
custom_value "JOB_TYP"
|
140
|
+
end
|
141
|
+
|
142
|
+
def recent_income
|
143
|
+
custom_value "RCNT_INCM"
|
144
|
+
end
|
145
|
+
|
146
|
+
def recent_income_currency_type
|
147
|
+
custom_value "RCNT_INCM_CRCY_TYP"
|
148
|
+
end
|
149
|
+
|
150
|
+
def recent_income_type
|
151
|
+
custom_value "RCNT_INCM_TYP"
|
152
|
+
end
|
153
|
+
|
154
|
+
def it_skill
|
155
|
+
custom_value "IT_SKILLS"
|
156
|
+
end
|
157
|
+
|
158
|
+
def certifications
|
159
|
+
custom_value "CERTS"
|
160
|
+
end
|
161
|
+
|
162
|
+
def management_experience
|
163
|
+
custom_value "MGMT_EXP"
|
164
|
+
end
|
165
|
+
|
166
|
+
def lang_prof(id_lang)
|
167
|
+
custom_value "LANG_PROF" + id_lang
|
168
|
+
end
|
169
|
+
|
170
|
+
def langs
|
171
|
+
custom_value "LANGS"
|
172
|
+
end
|
173
|
+
|
174
|
+
def lang(id_lang)
|
175
|
+
custom_value "LANG" + id_lang
|
176
|
+
end
|
91
177
|
end
|
92
178
|
|
93
179
|
class CbResume::CbCompanyExperience
|
@@ -116,6 +202,14 @@ module Cb
|
|
116
202
|
end
|
117
203
|
end
|
118
204
|
|
205
|
+
class CbResume::CbLanguage
|
206
|
+
attr_accessor :name
|
207
|
+
|
208
|
+
def initialize(code = '')
|
209
|
+
@name = code
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
119
213
|
class CbResume::CbCustomValue
|
120
214
|
attr_accessor :key, :value
|
121
215
|
|
data/lib/cb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
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.6
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Jesse Retchko
|
@@ -15,11 +16,12 @@ authors:
|
|
15
16
|
autorequire:
|
16
17
|
bindir: bin
|
17
18
|
cert_chain: []
|
18
|
-
date: 2013-08-
|
19
|
+
date: 2013-08-09 00:00:00.000000000 Z
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: httparty
|
22
23
|
requirement: !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
23
25
|
requirements:
|
24
26
|
- - ~>
|
25
27
|
- !ruby/object:Gem::Version
|
@@ -27,6 +29,7 @@ dependencies:
|
|
27
29
|
type: :runtime
|
28
30
|
prerelease: false
|
29
31
|
version_requirements: !ruby/object:Gem::Requirement
|
32
|
+
none: false
|
30
33
|
requirements:
|
31
34
|
- - ~>
|
32
35
|
- !ruby/object:Gem::Version
|
@@ -34,6 +37,7 @@ dependencies:
|
|
34
37
|
- !ruby/object:Gem::Dependency
|
35
38
|
name: json
|
36
39
|
requirement: !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
37
41
|
requirements:
|
38
42
|
- - ~>
|
39
43
|
- !ruby/object:Gem::Version
|
@@ -41,6 +45,7 @@ dependencies:
|
|
41
45
|
type: :runtime
|
42
46
|
prerelease: false
|
43
47
|
version_requirements: !ruby/object:Gem::Requirement
|
48
|
+
none: false
|
44
49
|
requirements:
|
45
50
|
- - ~>
|
46
51
|
- !ruby/object:Gem::Version
|
@@ -48,6 +53,7 @@ dependencies:
|
|
48
53
|
- !ruby/object:Gem::Dependency
|
49
54
|
name: nori
|
50
55
|
requirement: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
51
57
|
requirements:
|
52
58
|
- - ~>
|
53
59
|
- !ruby/object:Gem::Version
|
@@ -55,6 +61,7 @@ dependencies:
|
|
55
61
|
type: :runtime
|
56
62
|
prerelease: false
|
57
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
58
65
|
requirements:
|
59
66
|
- - ~>
|
60
67
|
- !ruby/object:Gem::Version
|
@@ -126,25 +133,26 @@ files:
|
|
126
133
|
- README.md
|
127
134
|
homepage: http://api.careerbuilder.com
|
128
135
|
licenses: []
|
129
|
-
metadata: {}
|
130
136
|
post_install_message:
|
131
137
|
rdoc_options: []
|
132
138
|
require_paths:
|
133
139
|
- lib
|
134
140
|
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
none: false
|
135
142
|
requirements:
|
136
143
|
- - ! '>='
|
137
144
|
- !ruby/object:Gem::Version
|
138
145
|
version: '0'
|
139
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
|
+
none: false
|
140
148
|
requirements:
|
141
149
|
- - ! '>='
|
142
150
|
- !ruby/object:Gem::Version
|
143
151
|
version: '0'
|
144
152
|
requirements: []
|
145
153
|
rubyforge_project:
|
146
|
-
rubygems_version:
|
154
|
+
rubygems_version: 1.8.25
|
147
155
|
signing_key:
|
148
|
-
specification_version:
|
156
|
+
specification_version: 3
|
149
157
|
summary: Ruby wrapper around Careerbuilder Public API.
|
150
158
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
YjkzYWU4YzM5ODk2YzIzY2IxNDJmMjFkZTQ2MTg0NTQ2ZmVhMWQyYg==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NjY5MTkxZmY5ZjRhODAzOWYzNTRiZTVjZjkwMWFjN2UxMjFjYWI5MA==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
ZDJmZjM5MmNkY2RiM2U1NWI4MmZlMGNmNTVlNDFkODA2MzFhOTM3ZGE5NWY1
|
10
|
-
ZmVkYmNmNDk5ZWUwOTNiZmY5NzYwYWI1OGQ2NGQwNzdkYzA0ODBkZWQzY2Y2
|
11
|
-
ODJjMGJlMDgzODkwMTMzNDJiYWEyZjVjOTg2N2M3ZmM5Y2FjMjQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YjM5ZmNjYzY2YjVhNWQ5ZGU5ZDQzYWU5ZTcyZGNkMWMwZGI3NTk1MzM5NTkw
|
14
|
-
MTUxMWYzNWZkMWFmYTAyMmZiNWJkZTkxODliOWNiNDg0NWU3NTlmZTI2ZmM4
|
15
|
-
NWU3ODRkYmEzOTRkNTFhNjk0MjRiMmExMGY2YzgwZjRkNjVjOWU=
|