opening_hours_converter 1.4.12 → 1.4.13

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: 48138064f71a751ea594cedc2aaf1f1d37b3c559
4
- data.tar.gz: 800f221ab81ae26a83b37ae553eba9424e49fe3f
3
+ metadata.gz: 06ce9d47aedbd6214a4569f1b6da79da7b220932
4
+ data.tar.gz: 030e18c02f49842eb3941be10e646dfc72216805
5
5
  SHA512:
6
- metadata.gz: 638e6a3a96c62a3389558bd36845ec960309c8479432464b55b0492011a304fe9c626a2092084502860aba9a4a485b0b45a98a128f22ccfc36edae4f10d5c6aa
7
- data.tar.gz: cc393958957946b94eb7e437cfa6922da85e85f0698895f27e4ddbffd5eb3bc2441f7822cb93fae79ba7ebcddc79b652f8664babd99784af2e993a03ae34f68e
6
+ metadata.gz: 3cc1a7ddd9c4036cee74091c148a04b2f381cd5b9e51eb0c5e789bfa0dcb25907e1b5f620e39b36706c701b5c8dd2d44321f4503b390d77d165e546e09386627
7
+ data.tar.gz: 38e45642d03eea097e5ff967fb746bbd98d559f8352f970444d8011dadcc524ef638a910522a81119ca442661a343d688c68085346cbbf8b503a40f7c34943f9
@@ -263,7 +263,7 @@ module OpeningHoursConverter
263
263
 
264
264
  def from_json(json)
265
265
  parsed = JSON.parse(json)
266
- date_range = {}
266
+ date_range = []
267
267
  parsed.each do |dr|
268
268
  wi = {}
269
269
  start_day = DateTime.parse(dr["wide_interval"]["start"])
@@ -274,17 +274,17 @@ module OpeningHoursConverter
274
274
  else
275
275
  wi = OpeningHoursConverter::WideInterval.new.day(start_day.day, start_day.month, start_day.year, end_day.day, end_day.month, end_day.year)
276
276
  end
277
- date_range = OpeningHoursConverter::DateRange.new(wi)
277
+ date_range << OpeningHoursConverter::DateRange.new(wi)
278
+ date_range.last.add_comment(dr["comment"])
278
279
  dr["typical"]["intervals"].each do |interval|
279
280
  if !interval.nil?
280
281
  start_interval = DateTime.parse(interval["start"])
281
282
  end_interval = DateTime.parse(interval["end"])
282
- date_range.typical.add_interval(OpeningHoursConverter::Interval.new(((start_interval.wday + 6) % 7), (start_interval.hour * 60 + start_interval.min), ((end_interval.wday + 6) % 7), (end_interval.hour * 60 + end_interval.min)))
283
+ date_range.last.typical.add_interval(OpeningHoursConverter::Interval.new(((start_interval.wday + 6) % 7), (start_interval.hour * 60 + start_interval.min), ((end_interval.wday + 6) % 7), (end_interval.hour * 60 + end_interval.min)))
283
284
  end
284
285
  end
285
- date_range.add_comment(dr["comment"])
286
286
  end
287
- [date_range]
287
+ date_range
288
288
  end
289
289
 
290
290
  def get_year(wrs)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opening_hours_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.12
4
+ version: 1.4.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziserman Martin