opening_hours_converter 1.3.4 → 1.3.5
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7d37b252319e4c869b7ea7aa6cee44813c745d3
|
4
|
+
data.tar.gz: 286e05c551c3ecd6faff2515c24815262c50f2e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 054a05d8fb67787c2648bffa37e05cd7f92602c74901bc3cd92e5324b2120fb04dddeb4eb9521f68b6cb743f26c48e56c3142ca631a1ebbf4626952f817f0a1d
|
7
|
+
data.tar.gz: fb9d52a16a98d97063d236d912d825eae78649b13c337cbe1512926e9ccb9447724ef62f7489100036b3a74270f363ff769853bcc8aa47c80323720668ef4680
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'opening_hours_converter/constants'
|
2
|
-
|
2
|
+
require 'pry-nav'
|
3
3
|
module OpeningHoursConverter
|
4
4
|
class OpeningHoursBuilder
|
5
5
|
include Constants
|
@@ -107,11 +107,21 @@ module OpeningHoursConverter
|
|
107
107
|
end
|
108
108
|
|
109
109
|
result = ""
|
110
|
-
rules.
|
111
|
-
|
112
|
-
|
110
|
+
if rules.length == 0
|
111
|
+
|
112
|
+
date_ranges.each do |dr|
|
113
|
+
if dr.wide_interval.type != "always"
|
114
|
+
result += "#{dr.wide_interval.get_time_selector} off"
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
else
|
119
|
+
rules.each_with_index do |rule, rule_index|
|
120
|
+
if rule_index > 0
|
121
|
+
result += "; "
|
122
|
+
end
|
123
|
+
result += rule.get
|
113
124
|
end
|
114
|
-
result += rule.get
|
115
125
|
end
|
116
126
|
|
117
127
|
return result
|
@@ -24,7 +24,7 @@ module OpeningHoursConverter
|
|
24
24
|
result = []
|
25
25
|
blocks = oh.split(';')
|
26
26
|
|
27
|
-
comment =
|
27
|
+
comment = ""
|
28
28
|
rule_modifier = nil
|
29
29
|
time_selector = nil
|
30
30
|
weekday_selector = nil
|
@@ -193,6 +193,7 @@ module OpeningHoursConverter
|
|
193
193
|
res_dr_id = 0
|
194
194
|
|
195
195
|
while res_dr_id < result.length && !found_date_range
|
196
|
+
# binding.pry
|
196
197
|
if result[res_dr_id].wide_interval.equals(dr) && result[res_dr_id].comment == comment
|
197
198
|
found_date_range = true
|
198
199
|
else
|
@@ -248,6 +249,7 @@ module OpeningHoursConverter
|
|
248
249
|
|
249
250
|
for t_id in 0...times.length
|
250
251
|
if rule_modifier == "closed" || rule_modifier == "off"
|
252
|
+
# binding.pry
|
251
253
|
remove_interval(dr_obj.typical, weekdays[wd_id], times[t_id])
|
252
254
|
else
|
253
255
|
add_interval(dr_obj.typical, weekdays[wd_id], times[t_id])
|
@@ -256,6 +258,7 @@ module OpeningHoursConverter
|
|
256
258
|
end
|
257
259
|
end
|
258
260
|
end
|
261
|
+
# binding.pry
|
259
262
|
|
260
263
|
return result
|
261
264
|
end
|