bobhr 0.3.0 → 0.3.4
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.rb +17 -1
- data/lib/bob/reports.rb +13 -0
- data/lib/bob/time_off.rb +4 -0
- data/lib/bob/version.rb +1 -1
- data/lib/bob/webhooks.rb +10 -0
- data/lib/bob.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90881d623b810aaf7a5469ea86edbad348cf430961b4f166667c30931881a054
|
4
|
+
data.tar.gz: bfc0f96e9a49e0c11ebeb326a006ea5a2c03dafc8b9d3ae50be63171b93abd8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c68aa05573becd8c2532b7150161c86fc32a791173ec8f63edbc4461cab734f929ee6c535d2cf10813b634958f1b6f455e22182356b15198c0a080a2a96bd1f7
|
7
|
+
data.tar.gz: 18735135af683b46d6b17ac7d27f8426ee43e8815db6dfea552072d71a3e0851dd6e5c5569c939b545f5fa45abce466de5931083caa9b56796403c9d6339ca6e
|
data/lib/bob/api.rb
CHANGED
@@ -4,14 +4,17 @@ require 'rest-client'
|
|
4
4
|
require 'json'
|
5
5
|
require 'uri'
|
6
6
|
require 'base64'
|
7
|
+
require 'csv'
|
7
8
|
|
8
9
|
module Bob
|
9
10
|
class API
|
10
11
|
BASE_URL = 'https://api.hibob.com'
|
11
12
|
|
12
|
-
def self.get(endpoint, params = {})
|
13
|
+
def self.get(endpoint, params = {}, csv_response = false)
|
13
14
|
url = build_url(endpoint, params)
|
14
15
|
response = RestClient.get(url, headers)
|
16
|
+
return create_csv(response.body) if csv_response
|
17
|
+
|
15
18
|
JSON.parse(response.body)
|
16
19
|
end
|
17
20
|
|
@@ -52,5 +55,18 @@ module Bob
|
|
52
55
|
|
53
56
|
url
|
54
57
|
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def self.create_csv(content)
|
62
|
+
content.gsub!("\r", '').gsub!("", '')
|
63
|
+
splitted = content.split("\n")
|
64
|
+
CSV.open("response.csv", "wb") do |csv|
|
65
|
+
csv << splitted.shift.split(',')
|
66
|
+
splitted.each do |row|
|
67
|
+
csv << row.split(',')
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
55
71
|
end
|
56
72
|
end
|
data/lib/bob/reports.rb
ADDED
data/lib/bob/time_off.rb
CHANGED
data/lib/bob/version.rb
CHANGED
data/lib/bob/webhooks.rb
ADDED
data/lib/bob.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.3.
|
4
|
+
version: 0.3.4
|
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-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -61,8 +61,10 @@ files:
|
|
61
61
|
- lib/bob/metadata/company_fields.rb
|
62
62
|
- lib/bob/metadata/company_lists.rb
|
63
63
|
- lib/bob/onboarding_wizards.rb
|
64
|
+
- lib/bob/reports.rb
|
64
65
|
- lib/bob/time_off.rb
|
65
66
|
- lib/bob/version.rb
|
67
|
+
- lib/bob/webhooks.rb
|
66
68
|
- lib/bobhr.rb
|
67
69
|
homepage: https://github.com/lienvdsteen/hibob
|
68
70
|
licenses:
|