bobhr 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bob/api/api.rb +12 -0
- data/lib/bob/api/employee/documents.rb +2 -2
- data/lib/bob/configuration.rb +2 -1
- data/lib/bob/models/employee.rb +4 -0
- data/lib/bob/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 830aed0d496d361b22920509e3f59f00cc0c15b71c9d9c4e1e36ad31a0189ea9
|
4
|
+
data.tar.gz: 8ef2f6a47e1fb831c2b38b0a992f47fcbf22164e76cc04ccee09f400d8a21863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d674a8bbbff9ea7070392e3df5c93b447002ffffe85d422617959cf921d922a9f1a0f6e898521013c5edcf216d0868122ed3cd3fec8f24f99d5ba70d630776b9
|
7
|
+
data.tar.gz: 6faea74ea478adfc54f8856cb4c3b12151b56212c73f2850ed8f1a2f541081082ef6571fffbb83580412887da9b85ac89bb6601eb83b0bcb0f3a084a97b747b7
|
data/lib/bob/api/api.rb
CHANGED
@@ -24,6 +24,12 @@ module Bob
|
|
24
24
|
response.code
|
25
25
|
end
|
26
26
|
|
27
|
+
def self.post_media(endpoint, params = {})
|
28
|
+
url = build_url(endpoint)
|
29
|
+
response = RestClient.post(url, params.to_json, media_headers.merge(content_headers))
|
30
|
+
response.code
|
31
|
+
end
|
32
|
+
|
27
33
|
def self.delete(endpoint)
|
28
34
|
url = build_url(endpoint)
|
29
35
|
response = RestClient.delete(url)
|
@@ -42,6 +48,12 @@ module Bob
|
|
42
48
|
}
|
43
49
|
end
|
44
50
|
|
51
|
+
def self.media_headers
|
52
|
+
{
|
53
|
+
Authorization: Bob.api_key
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
45
57
|
def self.content_headers
|
46
58
|
{
|
47
59
|
Accept: 'application/json',
|
@@ -4,11 +4,11 @@ module Bob
|
|
4
4
|
module Employee
|
5
5
|
class Documents < API
|
6
6
|
def self.add_public_document(employee_id, params = {})
|
7
|
-
|
7
|
+
post_media("docs/people/#{employee_id}/shared", params)
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.add_private_document(employee_id, params = {})
|
11
|
-
|
11
|
+
post_media("docs/people/#{employee_id}/confidential", params)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/bob/configuration.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Bob
|
4
4
|
module Configuration
|
5
|
-
VALID_OPTIONS_KEYS = %i[access_token access_user_name api_version].freeze
|
5
|
+
VALID_OPTIONS_KEYS = %i[access_token access_user_name api_version api_key].freeze
|
6
6
|
attr_accessor(*VALID_OPTIONS_KEYS)
|
7
7
|
|
8
8
|
# Sets all configuration options to their default values
|
@@ -26,6 +26,7 @@ module Bob
|
|
26
26
|
self.api_version = 'v1'
|
27
27
|
self.access_token = ENV['ACCESS_TOKEN']
|
28
28
|
self.access_user_name = ENV['ACCESS_USER_NAME']
|
29
|
+
self.api_key = ENV['API_KEY']
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
data/lib/bob/models/employee.rb
CHANGED
data/lib/bob/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bobhr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lien Van Den Steen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|