cb-api 14.3.1 → 14.4.0
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.
- data/CHANGELOG.md +1 -0
- data/lib/cb/config.rb +1 -0
- data/lib/cb/models/implementations/state.rb +17 -0
- data/lib/cb/requests/data_lists/state.rb +28 -0
- data/lib/cb/responses/data_list/state.rb +22 -0
- data/lib/cb/utils/response_map.rb +2 -1
- data/lib/cb/version.rb +1 -1
- metadata +5 -2
data/CHANGELOG.md
CHANGED
data/lib/cb/config.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
module Cb
|
2
|
+
module Models
|
3
|
+
class State < ApiResponseModel
|
4
|
+
attr_accessor :key, :value
|
5
|
+
|
6
|
+
def set_model_properties
|
7
|
+
@key = api_response['StateId']
|
8
|
+
@value = api_response['StateName']
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
def required_fields
|
13
|
+
['StateId', 'StateName']
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_relative '../base'
|
2
|
+
|
3
|
+
module Cb
|
4
|
+
module Requests
|
5
|
+
module State
|
6
|
+
class Get < Base
|
7
|
+
def base_uri
|
8
|
+
'https://www.careerbuilder.com'
|
9
|
+
end
|
10
|
+
|
11
|
+
def endpoint_uri
|
12
|
+
Cb.configuration.uri_state_list
|
13
|
+
end
|
14
|
+
|
15
|
+
def http_method
|
16
|
+
:get
|
17
|
+
end
|
18
|
+
|
19
|
+
def query
|
20
|
+
{
|
21
|
+
countryCode: args[:country_code],
|
22
|
+
outputjson: true
|
23
|
+
}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Cb
|
2
|
+
module Responses
|
3
|
+
class State < ApiResponse
|
4
|
+
def validate_api_hash
|
5
|
+
required_response_field(root_node, response)
|
6
|
+
end
|
7
|
+
|
8
|
+
def extract_models
|
9
|
+
response[root_node].map { |state| Models::State.new(state) }
|
10
|
+
end
|
11
|
+
|
12
|
+
def hash_containing_metadata
|
13
|
+
response
|
14
|
+
end
|
15
|
+
|
16
|
+
def root_node
|
17
|
+
'Results'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -55,7 +55,8 @@ module Cb
|
|
55
55
|
Cb::Requests::User::Retrieve => Cb::Responses::User::Retrieve,
|
56
56
|
Cb::Requests::User::TemporaryPassword => Cb::Responses::User::TemporaryPassword,
|
57
57
|
|
58
|
-
Cb::Requests::WorkStatus::List => Cb::Responses::WorkStatus::List
|
58
|
+
Cb::Requests::WorkStatus::List => Cb::Responses::WorkStatus::List,
|
59
|
+
Cb::Requests::State::Get => Cb::Responses::State
|
59
60
|
}.merge response_hash_extension
|
60
61
|
end
|
61
62
|
|
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: 14.
|
4
|
+
version: 14.4.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-11-
|
12
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -232,6 +232,7 @@ files:
|
|
232
232
|
- lib/cb/responses/anonymous_saved_search/create.rb
|
233
233
|
- lib/cb/responses/application.rb
|
234
234
|
- lib/cb/responses/metadata.rb
|
235
|
+
- lib/cb/responses/data_list/state.rb
|
235
236
|
- lib/cb/responses/data_list/country_codes.rb
|
236
237
|
- lib/cb/responses/job/singular.rb
|
237
238
|
- lib/cb/responses/job/search.rb
|
@@ -272,6 +273,7 @@ files:
|
|
272
273
|
- lib/cb/models/implementations/application/form.rb
|
273
274
|
- lib/cb/models/implementations/application/cover_letter.rb
|
274
275
|
- lib/cb/models/implementations/application/response.rb
|
276
|
+
- lib/cb/models/implementations/state.rb
|
275
277
|
- lib/cb/models/implementations/job.rb
|
276
278
|
- lib/cb/models/implementations/collapsed_job_results.rb
|
277
279
|
- lib/cb/models/implementations/user.rb
|
@@ -332,6 +334,7 @@ files:
|
|
332
334
|
- lib/cb/requests/category/search.rb
|
333
335
|
- lib/cb/requests/application_external/submit_application.rb
|
334
336
|
- lib/cb/requests/company/find.rb
|
337
|
+
- lib/cb/requests/data_lists/state.rb
|
335
338
|
- lib/cb/requests/data_lists/country_codes.rb
|
336
339
|
- lib/cb/requests/resumes/list.rb
|
337
340
|
- lib/cb/requests/resumes/put.rb
|