eaternet 0.4.1 → 0.4.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 +4 -4
- data/lib/eaternet/agencies/snhd_lives.rb +20 -9
- data/lib/eaternet/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed980faad2a78ad6296326f407ecef535d48232b
|
4
|
+
data.tar.gz: 1a60560689dccb31966b409a293d319074ab641a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef0b520bc6259dfdcd473998c14d92a8f896ce6eccb8b75ccaed9b35a851829e7af500e937713c3772f405d99d5e426ad043adc4676d74aa0bb10ca1966e6bd6
|
7
|
+
data.tar.gz: d7ac9a6237cf1ac5f94856359b1c13b8dc35d8dfc7ce0bd0e922a85d1bc9f7b2176175458544604c850f38c4330cf6811d98a27151d8a0a312d73c687f2ad6e0
|
@@ -16,6 +16,11 @@ module Eaternet
|
|
16
16
|
.map { |proto| try_to_create_business(proto) }
|
17
17
|
end
|
18
18
|
|
19
|
+
def inspections
|
20
|
+
@prototype.inspections
|
21
|
+
.map { |proto| try_to_create_inspection(proto) }
|
22
|
+
end
|
23
|
+
|
19
24
|
def try_to_create_business(proto)
|
20
25
|
business(proto)
|
21
26
|
rescue ArgumentError => e
|
@@ -25,6 +30,15 @@ module Eaternet
|
|
25
30
|
nil
|
26
31
|
end
|
27
32
|
|
33
|
+
def try_to_create_inspection(proto)
|
34
|
+
inspection(proto)
|
35
|
+
rescue ArgumentError => e
|
36
|
+
logger.warn('SNHD LIVES adapter') do
|
37
|
+
"Could not create a LIVES Inspection from #{proto.inspect}: #{e}"
|
38
|
+
end
|
39
|
+
nil
|
40
|
+
end
|
41
|
+
|
28
42
|
def business(proto)
|
29
43
|
Business.new do |b|
|
30
44
|
b.business_id = proto.orig_key
|
@@ -36,15 +50,12 @@ module Eaternet
|
|
36
50
|
end
|
37
51
|
end
|
38
52
|
|
39
|
-
def
|
40
|
-
|
41
|
-
.
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
i.date = Date.parse(proto.date)
|
46
|
-
end
|
47
|
-
}
|
53
|
+
def inspection(proto)
|
54
|
+
Inspection.new do |i|
|
55
|
+
i.business_id = proto.business_orig_key
|
56
|
+
i.score = proto.demerits.nil? ? nil : 100 - proto.demerits.to_i
|
57
|
+
i.date = Date.parse(proto.date)
|
58
|
+
end
|
48
59
|
end
|
49
60
|
|
50
61
|
def violations
|
data/lib/eaternet/version.rb
CHANGED