opening_hours_converter 1.7.18 → 1.7.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opening_hours_converter/week.rb +56 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeaea66e8c4dc56c2789ffe800537d732ed77db3f2af9680d674d65d854333a0
|
4
|
+
data.tar.gz: 3184691bb45258453cf39e72daa97bf15e395b180889426071c04739f678cfec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76c0cdfb4243a7c5d98a0e028842f9ff476449aaed4e16b0bfb6772be554ebe4462cc60c15a7a408dd7483b5c007d59d167df1b9ba2704305c006a4aacfb1b6b
|
7
|
+
data.tar.gz: 201014a6ce2df90e339ab482787410c448e6303327a660af330b0424a11557c62096ea76b557a2858a1c883ee79aba04e61a6c4aa1ae54e91e03dfe22d3b06a5
|
@@ -14,22 +14,65 @@ module OpeningHoursConverter
|
|
14
14
|
|
15
15
|
@intervals.each do |interval|
|
16
16
|
if !interval.nil?
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
if
|
22
|
-
|
23
|
-
|
17
|
+
if interval.day_start > interval.day_end
|
18
|
+
for day in 0..interval.day_end
|
19
|
+
start_minute = 0
|
20
|
+
end_minute = (day == interval.day_end) ? interval.end : MINUTES_MAX
|
21
|
+
if interval.is_off
|
22
|
+
if start_minute && end_minute
|
23
|
+
for minute in 0..MINUTES_MAX
|
24
|
+
minute_array[day][minute] = "off"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
else
|
28
|
+
if start_minute && end_minute
|
29
|
+
if minute_array[day][0] == "off"
|
30
|
+
minute_array[day] = Array.new(MINUTES_MAX + 1, false)
|
31
|
+
end
|
32
|
+
for minute in start_minute..end_minute
|
33
|
+
minute_array[day][minute] = true
|
34
|
+
end
|
24
35
|
end
|
25
36
|
end
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
37
|
+
end
|
38
|
+
for day in interval.day_start..6
|
39
|
+
start_minute = (day == interval.day_start) ? interval.start : 0
|
40
|
+
end_minute = MINUTES_MAX
|
41
|
+
if interval.is_off
|
42
|
+
if start_minute && end_minute
|
43
|
+
for minute in 0..MINUTES_MAX
|
44
|
+
minute_array[day][minute] = "off"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
else
|
48
|
+
if start_minute && end_minute
|
49
|
+
if minute_array[day][0] == "off"
|
50
|
+
minute_array[day] = Array.new(MINUTES_MAX + 1, false)
|
51
|
+
end
|
52
|
+
for minute in start_minute..end_minute
|
53
|
+
minute_array[day][minute] = true
|
54
|
+
end
|
30
55
|
end
|
31
|
-
|
32
|
-
|
56
|
+
end
|
57
|
+
end
|
58
|
+
else
|
59
|
+
for day in interval.day_start..interval.day_end
|
60
|
+
start_minute = (day == interval.day_start) ? interval.start : 0
|
61
|
+
end_minute = (day == interval.day_end) ? interval.end : MINUTES_MAX
|
62
|
+
if interval.is_off
|
63
|
+
if start_minute && end_minute
|
64
|
+
for minute in 0..MINUTES_MAX
|
65
|
+
minute_array[day][minute] = "off"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
else
|
69
|
+
if start_minute && end_minute
|
70
|
+
if minute_array[day][0] == "off"
|
71
|
+
minute_array[day] = Array.new(MINUTES_MAX + 1, false)
|
72
|
+
end
|
73
|
+
for minute in start_minute..end_minute
|
74
|
+
minute_array[day][minute] = true
|
75
|
+
end
|
33
76
|
end
|
34
77
|
end
|
35
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opening_hours_converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ziserman Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|