cb-api 14.3.1 → 14.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,7 @@ Version History
2
2
  ====
3
3
  * All Version bumps are required to update this file as well!!
4
4
  ----
5
+ * 14.4.0 adding State list to the gem
5
6
  * 14.3.1 Fixed missing response mapping
6
7
  * 14.3.0 Added country codes api call
7
8
  * 14.2.0 Added resume language codes api call
@@ -88,6 +88,7 @@ module Cb
88
88
  @uri_resume_list ||= '/v3/resume/list'
89
89
  @uri_resume_language_codes ||= '/v1/languagecodes'
90
90
  @uri_country_codes ||= '/v1/countrycodes'
91
+ @uri_state_list ||= '/ajax/citysuggest.aspx'
91
92
  end
92
93
 
93
94
  def set_attr_accessors
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '14.3.1'
2
+ VERSION = '14.4.0'
3
3
  end
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.3.1
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 00:00:00.000000000 Z
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