cb-api 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +6 -14
- data/lib/cb/models/cb_job.rb +2 -1
- data/lib/cb/utils/api.rb +0 -1
- data/lib/cb/utils/response_array_extractor.rb +39 -0
- data/lib/cb/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
Yjg0ZTI5N2Q2N2Q2OThkMDM5OTNjNWRhMWYzNjAxYTkzYzU4ZjhkYzU2Njlh
|
10
|
-
OTY2NjA2ZmVjZTc3ZDMzMzhmZTBjNjZlNmE2ZTM5ZDI3YjA5MzNjYTVmYzM1
|
11
|
-
NTQ2ODc5OGNmMzM4MDA3Njk0NTA5YjQxNjkzMjAzYjQzNjU5NWM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NmFmNWU4NTNmYzczZWQyN2I1NzBlZDhjZDI0NTBhNGVhODc1OTlmNmJhM2M4
|
14
|
-
ZjViMDZkZjZjYTgwODRjNDQ1NTExMTY1NTUwZGIwN2I3ZDZhYTc1NTM5YjI0
|
15
|
-
OWVhZTY4MjYzZDMyN2IxNGM3YzQ3OWIxMjg0ZjEwMDgyYTVhMTI=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5af097e5f84f9301bb71091b2e5be518c70f9116
|
4
|
+
data.tar.gz: 78e825811b8b715507829172fbb5fe042e844225
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ba0df1c69b5b31e8281fb31a8a1c9ed4b891d7725cba9532eb98101b82319b6e5f588da691031925d9ca5e82255162f8b4244969407fadeea8821832fd8bc219
|
7
|
+
data.tar.gz: a135df61452c59ea127534e3fa9481f22774b843262677397dc76df324d021ffbdd4358664e281b04d121392b94533ca14cd25a571e69501b8dac4dc2a4d63d9
|
data/lib/cb/models/cb_job.rb
CHANGED
@@ -10,7 +10,7 @@ module Cb
|
|
10
10
|
:details_url, :service_url, :similar_jobs_url, :apply_url,
|
11
11
|
:begin_date, :end_date, :posted_date,
|
12
12
|
:relevancy, :state, :city, :zip,
|
13
|
-
:can_be_quick_applied
|
13
|
+
:can_be_quick_applied, :apply_requirements
|
14
14
|
|
15
15
|
attr_writer :external_application, :relocation_covered, :manages_others, :is_screener_apply,
|
16
16
|
:is_shared_job
|
@@ -83,6 +83,7 @@ module Cb
|
|
83
83
|
@is_screener_apply = args['IsScreenerApply'] || ''
|
84
84
|
@is_shared_job = args['IsSharedJob'] || ''
|
85
85
|
@can_be_quick_applied = args['CanBeQuickApplied'] || ''
|
86
|
+
@apply_requirements = Cb::Utils::ResponseArrayExtractor.extract(args, 'ApplyRequirements')
|
86
87
|
|
87
88
|
# Company related
|
88
89
|
@company_name = args['Company'] || ''
|
data/lib/cb/utils/api.rb
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
module Cb
|
2
|
+
module Utils
|
3
|
+
class ResponseArrayExtractor
|
4
|
+
|
5
|
+
def self.extract(response_hash, key)
|
6
|
+
self.new(response_hash, key).extract
|
7
|
+
end
|
8
|
+
|
9
|
+
def initialize(response_hash, key)
|
10
|
+
@response_hash = response_hash
|
11
|
+
@key = key
|
12
|
+
@singular_key = key[0..key.length-2]
|
13
|
+
end
|
14
|
+
|
15
|
+
def extract
|
16
|
+
if response_has_collection?
|
17
|
+
extract_array_from_collection
|
18
|
+
else
|
19
|
+
[]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def response_has_collection?
|
26
|
+
!@response_hash[@key].nil? && !@response_hash[@key][@singular_key].nil?
|
27
|
+
end
|
28
|
+
|
29
|
+
def extract_array_from_collection
|
30
|
+
if @response_hash[@key][@singular_key].is_a?(Array)
|
31
|
+
@response_hash[@key][@singular_key]
|
32
|
+
else
|
33
|
+
[ @response_hash[@key][@singular_key] ]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
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: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Retchko
|
@@ -18,7 +18,7 @@ authors:
|
|
18
18
|
autorequire:
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
|
-
date: 2013-
|
21
|
+
date: 2013-10-03 00:00:00.000000000 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
name: httparty
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- lib/cb/utils/country.rb
|
143
143
|
- lib/cb/utils/fluid_attributes.rb
|
144
144
|
- lib/cb/utils/meta_values.rb
|
145
|
+
- lib/cb/utils/response_array_extractor.rb
|
145
146
|
- lib/cb/utils/string.rb
|
146
147
|
- lib/cb/utils/validator.rb
|
147
148
|
- lib/cb/version.rb
|
@@ -156,12 +157,12 @@ require_paths:
|
|
156
157
|
- lib
|
157
158
|
required_ruby_version: !ruby/object:Gem::Requirement
|
158
159
|
requirements:
|
159
|
-
- -
|
160
|
+
- - '>='
|
160
161
|
- !ruby/object:Gem::Version
|
161
162
|
version: '0'
|
162
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
164
|
requirements:
|
164
|
-
- -
|
165
|
+
- - '>='
|
165
166
|
- !ruby/object:Gem::Version
|
166
167
|
version: '0'
|
167
168
|
requirements: []
|