calc_working_hours 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e62cd3602d8f49dc90e544e0b2580960b9e94078
4
- data.tar.gz: 9a2678dd83beb26211dc54edfb1acab0d88a06b9
3
+ metadata.gz: 0047ebcca2b690bd15b5398b9459ebbd465ab178
4
+ data.tar.gz: e1e1c511a76a51aea4bc1e631b0ce5a5603b76f4
5
5
  SHA512:
6
- metadata.gz: fc288e02ccf5e5a1816988b084d58cd66db6bdd82f8460d2f25a94bd4499c5397eaa01a7f9b6419564a00446d0a9629553e205c3bffc7d618de8bff6cbe5eba9
7
- data.tar.gz: 3c55191807268da1e0541b23a6d498b78e1617ca4a209471773c28e641df89b9a59a5ca061002ee0bd3f9ddfe5bf9913b3f8021d76517b3ae1705c98cdd19150
6
+ metadata.gz: 282823665e7a2b62047210bdc7b9385c28e6775d34e00d5c5790eecddd8bd6f8cf0b91f4ea7a5b9e55019b7b0a5926e3e9e23d5c36356c370a174eedd0d55b93
7
+ data.tar.gz: 0b065bef664a247d9dbfdf17ecc8e1f7e158e5eed338d049ca9b8a51958fdd9670e01106ba011684df1faffb46c9e51f301f9b35d741e1be89d7945b4f8f1274
@@ -41,6 +41,9 @@ module CalcWorkingHours
41
41
  def valid_break_time?(break_time, starting_time, ending_time)
42
42
  flag = false
43
43
  break_time.each do |time|
44
+ unless time
45
+ return flag = true
46
+ end
44
47
  if time.length == 2 && time.class == Array
45
48
  if valid_time_format?(time[0]) && valid_time_format?(time[1])
46
49
  time.each do |t|
@@ -60,7 +63,9 @@ module CalcWorkingHours
60
63
  def total_break_time(break_time)
61
64
  total = WorkingHours.new("0:00")
62
65
  break_time.each do |time|
63
- total.add_time(time[1]).minus_time(time[0])
66
+ unless time
67
+ total.add_time(time[1]).minus_time(time[0])
68
+ end
64
69
  end
65
70
  return total
66
71
  end
@@ -1,3 +1,3 @@
1
1
  module CalcWorkingHours
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calc_working_hours
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi_U