bobhr 0.5.12 → 0.5.13
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 +16 -0
- data/lib/bob/api/employee/documents.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: f6833af093ceefa5ffbd4f56748c4cacc0abc6a9eef88a42fcf1b1ad5d00a171
|
4
|
+
data.tar.gz: 863f017eb7bccf7904c060b140b5fd2c4cfbaa43b5533d4631974623342c052d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6683be064cc627dcfe6c8bb136870cbb71231034475d1b178f2a46c42944527d16371c17b24ffcdc06a84f82cc72ced0387209b12efb68bdb66de6276f9a5821
|
7
|
+
data.tar.gz: b09ee6b29014ace8b434520c914c87994b2980c0da369fdb134aeb9c995c4db4e3e844945f1f969de4cbe315738d5101da0121d204932ae02159ed4bf3fe6ab1
|
data/lib/bob/api/api.rb
CHANGED
@@ -34,6 +34,22 @@ module Bob
|
|
34
34
|
response.code
|
35
35
|
end
|
36
36
|
|
37
|
+
def self.post_file(endpoint, file_path)
|
38
|
+
url = build_url(endpoint)
|
39
|
+
payload = {
|
40
|
+
multipart: true,
|
41
|
+
file: File.new(file_path)
|
42
|
+
}
|
43
|
+
|
44
|
+
headers = {
|
45
|
+
Accept: 'application/json',
|
46
|
+
'Content-Type': 'multipart/form-data',
|
47
|
+
Authorization: "Basic #{Base64.strict_encode64("#{Bob.access_user_name}:#{Bob.access_token}")}"
|
48
|
+
}
|
49
|
+
response = RestClient.post(url, payload, headers)
|
50
|
+
response.code
|
51
|
+
end
|
52
|
+
|
37
53
|
def self.delete(endpoint)
|
38
54
|
url = build_url(endpoint)
|
39
55
|
response = RestClient.delete(url)
|
@@ -10,6 +10,10 @@ module Bob
|
|
10
10
|
def self.add_private_document(employee_id, params = {})
|
11
11
|
post("docs/people/#{employee_id}/confidential", params, use_api_key: true)
|
12
12
|
end
|
13
|
+
|
14
|
+
def self.upload_public_document(employee_id, file_path)
|
15
|
+
post_file("docs/people/#{employee_id}/shared/upload", file_path)
|
16
|
+
end
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
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.13
|
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-06-
|
11
|
+
date: 2022-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|