bobhr 0.5.12 → 0.5.15
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/models/base.rb +1 -0
- data/lib/bob/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fbc4a2d88ccb3778bf83513c95f4606124535d1aeff8fe84732c5ebf269b6f7
|
4
|
+
data.tar.gz: 4f307468c30e25e38a7b1bcc3d32c9d4689563975f4740adf9e449f97bbbe217
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d35199c9347fe57876644c4c674fe4a04a78160c2e20beffbfb0408534e886ed6cb4850d28758522af052271ff7e6cc2e80b864df37b17bbbbe618e34c2a8cf9
|
7
|
+
data.tar.gz: 27191a97466465ca5ebf761ed6f7642e139f1777dc1e1c52ba9b4a6408b37b110993c501bda136a8c2aba444fe275eabafed5b2c5d6a2fefae73d11d1f52ff14
|
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/models/base.rb
CHANGED
@@ -6,6 +6,7 @@ module Models
|
|
6
6
|
attributes = Bob::Util.underscorize_hash(raw)
|
7
7
|
|
8
8
|
attributes.each do |k, v|
|
9
|
+
k = "field_#{k}" if k.class == String && k.to_i > 0
|
9
10
|
instance_variable_set("@#{k}", v.is_a?(Hash) ? Models::Base.new(v) : v)
|
10
11
|
self.class.send(:define_method, k, proc { instance_variable_get("@#{k}") })
|
11
12
|
self.class.send(:define_method, "#{k}=", proc { |val| instance_variable_set("@#{k}", val) })
|
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.15
|
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-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.3.7
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Ruby gem for Bob API
|