cb-api 7.3.0 → 7.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -81,6 +81,7 @@ Currently, this workflow only works on the following endpoints:
81
81
  * Anonymous Saved Search
82
82
  * Application
83
83
  * Application External
84
+ * Category
84
85
  * User
85
86
 
86
87
  Look here for future updates on this refactor!
@@ -0,0 +1,25 @@
1
+ require_relative '../base'
2
+
3
+ module Cb
4
+ module Requests
5
+ module Category
6
+ class Search < Base
7
+
8
+ def endpoint_uri
9
+ Cb.configuration.uri_job_category_search
10
+ end
11
+
12
+ def http_method
13
+ :get
14
+ end
15
+
16
+ def query
17
+ {
18
+ CountryCode: @args[:host_site]
19
+ }
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,44 @@
1
+ require 'cb/responses/api_response'
2
+
3
+ module Cb
4
+ module Responses
5
+ module Category
6
+ class Search < ApiResponse
7
+
8
+ protected
9
+
10
+ def hash_containing_metadata
11
+ response
12
+ end
13
+
14
+ def validate_api_hash
15
+ required_response_field(response_node, response)
16
+ required_response_field(categories_node, response[response_node])
17
+ required_response_field(category_node, response[response_node][categories_node])
18
+ end
19
+
20
+ def extract_models
21
+ model_array.map { |category| Cb::Models::Category.new(category) }
22
+ end
23
+
24
+ private
25
+
26
+ def response_node
27
+ "ResponseCategories"
28
+ end
29
+
30
+ def categories_node
31
+ "Categories"
32
+ end
33
+
34
+ def category_node
35
+ "Category"
36
+ end
37
+
38
+ def model_array
39
+ response[response_node][categories_node][category_node]
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -18,10 +18,6 @@ module Cb
18
18
  model
19
19
  end
20
20
 
21
- def metadata_containing_node
22
- response[root_node]
23
- end
24
-
25
21
  def hash_containing_metadata
26
22
  response
27
23
  end
@@ -25,10 +25,6 @@ module Cb
25
25
  model
26
26
  end
27
27
 
28
- def metadata_containing_node
29
- response[root_node]
30
- end
31
-
32
28
  def hash_containing_metadata
33
29
  response
34
30
  end
@@ -18,10 +18,6 @@ module Cb
18
18
  model
19
19
  end
20
20
 
21
- def metadata_containing_node
22
- response[root_node]
23
- end
24
-
25
21
  def hash_containing_metadata
26
22
  response
27
23
  end
@@ -15,10 +15,6 @@ module Cb
15
15
  Models::User.new response[root_node][user_info_node]
16
16
  end
17
17
 
18
- def metadata_containing_node
19
- response[root_node]
20
- end
21
-
22
18
  def hash_containing_metadata
23
19
  response
24
20
  end
@@ -22,6 +22,8 @@ module Cb
22
22
 
23
23
  Cb::Requests::ApplicationExternal::SubmitApplication => Cb::Responses::ApplicationExternal::SubmitApplication,
24
24
 
25
+ Cb::Requests::Category::Search => Cb::Responses::Category::Search,
26
+
25
27
  Cb::Requests::User::ChangePassword => Cb::Responses::User::ChangePassword,
26
28
  Cb::Requests::User::CheckExisting => Cb::Responses::User::CheckExisting,
27
29
  Cb::Requests::User::Delete => Cb::Responses::User::Delete,
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '7.3.0'
2
+ VERSION = '7.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: 7.3.0
4
+ version: 7.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-05-29 00:00:00.000000000 Z
12
+ date: 2014-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -118,7 +118,7 @@ dependencies:
118
118
  requirement: !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements:
121
- - - ! '>='
121
+ - - ~>
122
122
  - !ruby/object:Gem::Version
123
123
  version: '2.14'
124
124
  type: :development
@@ -126,7 +126,7 @@ dependencies:
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
- - - ! '>='
129
+ - - ~>
130
130
  - !ruby/object:Gem::Version
131
131
  version: '2.14'
132
132
  - !ruby/object:Gem::Dependency
@@ -225,6 +225,7 @@ files:
225
225
  - lib/cb/responses/user/temporary_password.rb
226
226
  - lib/cb/responses/user/retrieve.rb
227
227
  - lib/cb/responses/timing.rb
228
+ - lib/cb/responses/category/search.rb
228
229
  - lib/cb/responses/application_external/submit_application.rb
229
230
  - lib/cb/responses/saved_search/list.rb
230
231
  - lib/cb/responses/saved_search/singular.rb
@@ -282,6 +283,7 @@ files:
282
283
  - lib/cb/requests/user/temporary_password.rb
283
284
  - lib/cb/requests/user/retrieve.rb
284
285
  - lib/cb/requests/base.rb
286
+ - lib/cb/requests/category/search.rb
285
287
  - lib/cb/requests/application_external/submit_application.rb
286
288
  - lib/cb/convenience.rb
287
289
  - lib/cb/clients/job_branding.rb