bobhr 0.5.0 → 0.5.1

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: 7802322c3f4a72dbd2ce8b8c91a5e9a1505c4cb597ffc599c77316b4e40a1909
4
- data.tar.gz: a037d12cbce500ccbf53affc99eceb321481dafad72503e98681a11176b8b8b7
3
+ metadata.gz: 7be7ee6eb8986610c73cb5b369e2ba00cdb23b1ab33762e470fe35f141ccb95e
4
+ data.tar.gz: '08f8d8c2aed85d5d59bb68b269e0edbbaaa6c0d89b15613b7ed16c0b492e331f'
5
5
  SHA512:
6
- metadata.gz: 2d9b871d2cb78cf68e75ca628b499237740950e95f0484c9ad1ee40ea909eccbbcad128f5730f728f01b95f832edb8e06b20cb693c27da6931bbc6ef54ab94d4
7
- data.tar.gz: b58cb07c4851cc7d8ce37a36ff13fa99def9122efffff45cbe13054db24c6a9a4dfd4690fa4e53256ba55bfaf621e7990996f5c6126777dd64302db672d2b3ef
6
+ metadata.gz: 463751142a4aaf1dd4112d38ac2f5849ff6b0228336a220ec61294e608639189674d2ef844cbc8ac6d88d4a93b6898240aadc5d01038916a79984306e0d7b6e2
7
+ data.tar.gz: eea598bc6402bcf2c28ed741fcb574d395b4a617a6e1bd75194f0dd6449d22ea419b341122ac77e4753ee48d8e5904669763a71068986d6e3adb171c45354edc
@@ -15,7 +15,25 @@ module Models
15
15
  end
16
16
 
17
17
  def return_date
18
- @return_date = Date.parse(end_date) + 1.day
18
+ @return_date = parsed_end_date + 1.day
19
+ end
20
+
21
+ def multiple_days?
22
+ total_days_off > 1
23
+ end
24
+
25
+ def total_days_off
26
+ (start_date...end_date).count + 1
27
+ end
28
+
29
+ private
30
+
31
+ def parsed_start_date
32
+ Date.parse(start_date)
33
+ end
34
+
35
+ def parsed_end_date
36
+ Date.parse(end_date)
19
37
  end
20
38
  end
21
39
  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.0'
4
+ VERSION = '0.5.1'
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.0
4
+ version: 0.5.1
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-04 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubygems_version: 3.3.7
126
+ rubygems_version: 3.2.31
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Ruby gem for Bob API