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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd82730426161001e491b5231b6c352cea55a2ca26e6484d69ede72efc91b358
4
- data.tar.gz: 7c1b2c0062c6b5c781a05c508727d6d87cf821e89eca59e541703a569e2a3f07
3
+ metadata.gz: 830aed0d496d361b22920509e3f59f00cc0c15b71c9d9c4e1e36ad31a0189ea9
4
+ data.tar.gz: 8ef2f6a47e1fb831c2b38b0a992f47fcbf22164e76cc04ccee09f400d8a21863
5
5
  SHA512:
6
- metadata.gz: 5a4a4a2c923ce1edab07ad958b1d440b5912973118f3c2b7bb7b1f57dae96a9119fb76a4622b703431874444d3f0c430321fcf2c31946c494f074e609af28b8f
7
- data.tar.gz: 3284dbc7c578633bb45fca89843ccd85738244c20a66110b8984d0c28779708cb13802e87a7926fbb98e8c4b28012d68a29d345f13981f079dd1d1c74e443a3f
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
- post("docs/people/#{employee_id}/shared", params)
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
- post("docs/people/#{employee_id}/confidential", params)
11
+ post_media("docs/people/#{employee_id}/confidential", params)
12
12
  end
13
13
  end
14
14
  end
@@ -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
@@ -73,5 +73,9 @@ module Models
73
73
  def cost_center
74
74
  payroll.custom.field_1634476091511
75
75
  end
76
+
77
+ def personal_email
78
+ home.private_email
79
+ end
76
80
  end
77
81
  end
data/lib/bob/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bob
4
- VERSION = '0.5.6'
4
+ VERSION = '0.5.7'
5
5
  end
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.6
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-03-23 00:00:00.000000000 Z
11
+ date: 2022-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json