breathe 0.2.0 → 0.3.0

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: 50f00c9264cf4b355d988467f0410baeb78606cdc27ceba2e28a3e5671771f0c
4
- data.tar.gz: 8d815287afcee0bd8e58281869ae4bbb86df13f37fe15498b03c48d7f591d0a0
3
+ metadata.gz: 730f5f521725f470d139ffee0425cbc9df04ed07ca4785ce1c67fd9043ae15cc
4
+ data.tar.gz: e0c659cbbec9dbd2ffd24fac7178486b2e94502b1a35d643d31521f0e3b3acdc
5
5
  SHA512:
6
- metadata.gz: 1a7dbf1a5cf986f68e924c86ae9a3e17f87bf7ef3ab4e66f2b3edea262b23b132d9de35c5aa3bd0fb8d80bc48889ce4c512b96ee707b5693016b8dc24694b87f
7
- data.tar.gz: 5ab3b6c5fd7ab573b31804e593f1059ed1bc5a13d20819fe368baf8b9a844ed7a823b251382c46df15bcb535def9483710dbb59abe1dc0fe7ff13a91824e0c76
6
+ metadata.gz: ca27b9bd958517afdcf7b1457fdbe3522cff6cc4bfe6acaec85258410b29e4c11d2db2c43bab6103b2fa2aeaaef2f293f319a6d583a983668fd8a750e81e0fb1
7
+ data.tar.gz: fc65ad45281a859bad96842e621de81254b63ff8eeafa3c2b3259ccb5db7d65ea9f9a462194a5ae8e7a96d4f34bed6783fcee0cc032934317836e7a3aa2a704b
@@ -0,0 +1 @@
1
+ 2.6.5
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog]
6
6
 
7
+ [0.3.0]
8
+
9
+ - Allow listing of sicknesses
10
+ - Allow listing of employees and fetching a single employee
11
+
12
+ [0.2.0]
13
+
14
+ - Use Sawyer
15
+
7
16
  [0.1.2]
8
17
 
9
18
  - Raise an error when API key is incorrect
@@ -17,7 +26,9 @@ The format is based on [Keep a Changelog]
17
26
 
18
27
  - Allow listing of absences
19
28
 
20
- [0.1.1]: https://github.com/dxw/breathe_ruby/releases/tag/0.1.2
29
+ [0.3.0]: https://github.com/dxw/breathe_ruby/releases/tag/0.3.0
30
+ [0.2.0]: https://github.com/dxw/breathe_ruby/releases/tag/0.2.0
31
+ [0.1.2]: https://github.com/dxw/breathe_ruby/releases/tag/0.1.2
21
32
  [0.1.1]: https://github.com/dxw/breathe_ruby/releases/tag/0.1.1
22
33
  [0.1.0]: https://github.com/dxw/breathe_ruby/releases/tag/0.1.0
23
34
  [keep a changelog]: https://keepachangelog.com/en/1.0.0/
data/README.md CHANGED
@@ -38,11 +38,36 @@ client = Breathe::Client.new(api_key: YOUR_API_KEY)
38
38
 
39
39
  And use like so
40
40
 
41
+ ### List absences (Holiday and Other leave)
42
+
41
43
  ```ruby
42
44
  client.absences.list
43
45
  #=> [...]
44
46
  ```
45
47
 
48
+ ### List sicknesses
49
+
50
+ ```ruby
51
+ client.sicknesses.list
52
+ #=> [...]
53
+ ```
54
+
55
+ ### List employees
56
+
57
+ ```ruby
58
+ client.employees.list
59
+ #=> [...]
60
+ ```
61
+
62
+ ### Get an employee by ID
63
+
64
+ ```ruby
65
+ client.employees.get(id)
66
+ #=> [...]
67
+ ```
68
+
69
+ ### Filtering
70
+
46
71
  You can also pass in arguments like so:
47
72
 
48
73
  ```ruby
@@ -29,7 +29,6 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "rake", "~> 10.0"
30
30
  spec.add_development_dependency "rspec", "~> 3.0"
31
31
  spec.add_development_dependency "standard", "~> 0.1.5"
32
- spec.add_development_dependency "vcr", "~> 5.0"
33
32
  spec.add_development_dependency "dotenv", "~> 2.7.5"
34
33
  spec.add_development_dependency "pry", "~> 0.12.2"
35
34
  spec.add_development_dependency "webmock", "~> 3.7.6"
@@ -5,6 +5,8 @@ require "breathe/client"
5
5
  require "breathe/response"
6
6
 
7
7
  require "breathe/absences"
8
+ require "breathe/sicknesses"
9
+ require "breathe/employees"
8
10
 
9
11
  module Breathe
10
12
  class Error < StandardError; end
@@ -13,9 +13,17 @@ module Breathe
13
13
  @absences ||= Absences.new(self)
14
14
  end
15
15
 
16
- def response(method:, path:, args:)
16
+ def sicknesses
17
+ @sicknesses ||= Sicknesses.new(self)
18
+ end
19
+
20
+ def employees
21
+ @employees ||= Employees.new(self)
22
+ end
23
+
24
+ def response(method:, path:, args: {})
17
25
  response = request(method: method, path: path, options: {query: args})
18
- parsed_response = Response.new(response: response, type: path)
26
+ parsed_response = Response.new(response: response, type: path.split("/").first)
19
27
 
20
28
  if parsed_response.success?
21
29
  @auto_paginate ? auto_paginated_response(parsed_response) : parsed_response
@@ -0,0 +1,24 @@
1
+ module Breathe
2
+ class Employees
3
+ attr_reader :client
4
+
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ def list(args = {})
10
+ client.response(
11
+ method: :get,
12
+ path: "employees",
13
+ args: args
14
+ )
15
+ end
16
+
17
+ def get(id)
18
+ client.response(
19
+ method: :get,
20
+ path: "employees/#{id.to_i}"
21
+ )
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,17 @@
1
+ module Breathe
2
+ class Sicknesses
3
+ attr_reader :client
4
+
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ def list(args = {})
10
+ client.response(
11
+ method: :get,
12
+ path: "sicknesses",
13
+ args: args
14
+ )
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Breathe
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breathe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Harrison
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-16 00:00:00.000000000 Z
11
+ date: 2020-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.1.5
69
- - !ruby/object:Gem::Dependency
70
- name: vcr
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '5.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '5.0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: dotenv
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -148,6 +134,7 @@ files:
148
134
  - ".github/workflows/publish.yml"
149
135
  - ".gitignore"
150
136
  - ".rspec"
137
+ - ".ruby-version"
151
138
  - CHANGELOG.md
152
139
  - CODE_OF_CONDUCT.md
153
140
  - Gemfile
@@ -160,7 +147,9 @@ files:
160
147
  - lib/breathe.rb
161
148
  - lib/breathe/absences.rb
162
149
  - lib/breathe/client.rb
150
+ - lib/breathe/employees.rb
163
151
  - lib/breathe/response.rb
152
+ - lib/breathe/sicknesses.rb
164
153
  - lib/breathe/version.rb
165
154
  homepage: http://github.com/dxw/breathe_ruby
166
155
  licenses: