cb-api 20.2.0 → 20.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/lib/cb/clients/base.rb +11 -9
- data/lib/cb/clients/cover_letters.rb +29 -25
- data/lib/cb/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93505a4bc675cdacf5ff5a8fd8870b7276bae400
|
4
|
+
data.tar.gz: 576665c4765eabbcc5710dde17a20f6d5643841d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d03bb23f83f51ee41c77b6abeb8911fdc356c095b4edbd50d7d46477ad8ad029c8b45bc57d66423a254c9199cbe08be68c6e152503d19abddbf72791f6b2adc6
|
7
|
+
data.tar.gz: 617611843ed9a6cf44335d890ddbad19f03f8e79cbd2ff6777725128f2e36d737ee64de2c92d199531650073c5073b528a410eb343a3f62372e50d41a4998524
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,7 @@ Version History
|
|
2
2
|
====
|
3
3
|
* All Version bumps are required to update this file as well!!
|
4
4
|
----
|
5
|
+
* 20.2.1 `class << self` for classes with all class methods. DRY up the URI building for Cover Letter Update & Delete.
|
5
6
|
* 20.2.0 Adding job insights client
|
6
7
|
* 20.1.1 Having nil reponses behave more like we did pre ruby 2.2 so as not to break downstream peeps
|
7
8
|
* 20.1.0 Remove Migration ID field from resume listing model.
|
data/lib/cb/clients/base.rb
CHANGED
@@ -11,16 +11,18 @@
|
|
11
11
|
module Cb
|
12
12
|
module Clients
|
13
13
|
class Base
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
class << self
|
15
|
+
def cb_client
|
16
|
+
@cb_client ||= Cb::Utils::Api.instance
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
def headers(args)
|
20
|
+
{
|
21
|
+
'Accept' => 'application/json',
|
22
|
+
'Authorization' => "Bearer #{ args[:oauth_token] }",
|
23
|
+
'Content-Type' => 'application/json'
|
24
|
+
}
|
25
|
+
end
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
@@ -12,36 +12,40 @@ require_relative 'base'
|
|
12
12
|
module Cb
|
13
13
|
module Clients
|
14
14
|
class CoverLetters < Base
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
class << self
|
16
|
+
def get(args={})
|
17
|
+
uri = Cb.configuration.uri_cover_letters
|
18
|
+
uri += "/#{ args[:id] }" if args[:id]
|
19
|
+
cb_client.cb_get(uri, headers: headers(args))
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
def create(args={})
|
23
|
+
cb_client.cb_put(Cb.configuration.uri_cover_letters,
|
24
|
+
body: body(args),
|
25
|
+
headers: headers(args))
|
26
|
+
end
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
28
|
+
def delete(args={})
|
29
|
+
cb_client.cb_delete(uri_with_id(args), body: body(args), headers: headers(args))
|
30
|
+
end
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
def update(args={})
|
33
|
+
cb_client.cb_post(uri_with_id(args), body: body(args), headers: headers(args))
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
36
37
|
|
37
|
-
|
38
|
+
def uri_with_id(args)
|
39
|
+
"#{ Cb.configuration.uri_cover_letters }/#{ args[:id] }"
|
40
|
+
end
|
38
41
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
def body(args)
|
43
|
+
body = Hash.new
|
44
|
+
body[:id] = args[:id] if args[:id]
|
45
|
+
body[:text] = args[:text] if args[:text]
|
46
|
+
body[:name] = args[:name] if args[:name]
|
47
|
+
body.to_json
|
48
|
+
end
|
45
49
|
end
|
46
50
|
end
|
47
51
|
end
|
data/lib/cb/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2016 CareerBuilder, LLC
|
2
2
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
3
3
|
# you may not use this file except in compliance with the License.
|
4
4
|
# You may obtain a copy of the License at
|
@@ -9,5 +9,5 @@
|
|
9
9
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
10
|
# See the License for the specific language governing permissions and limitations under the License.
|
11
11
|
module Cb
|
12
|
-
VERSION = '20.2.
|
12
|
+
VERSION = '20.2.1'
|
13
13
|
end
|