eaternet 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,109 +0,0 @@
1
- module Eaternet
2
- module Framework
3
- # A first pass at a health scores mini-framework which
4
- # is denormalized and provides some more information than
5
- # LIVES.
6
- module Prototype
7
-
8
- module AbstractAdapter
9
- # @return [Enumerable<BusinessData>]
10
- def businesses
11
- fail 'Override this to return an Enumerable of BusinessData objects'
12
- end
13
-
14
- # @return [Enumerable<InspectionData>]
15
- def inspections
16
- fail 'Override this to return an Enumerable of InspectionData objects'
17
- end
18
-
19
- # @return [Enumerable<ViolationData>]
20
- def violations
21
- fail 'Override this to return an Enumerable of ViolationData objects'
22
- end
23
-
24
- # @return [Enumerable<ViolationData>]
25
- def violation_kinds
26
- fail 'Override this to return an Enumerable of ViolationKindData objects'
27
- end
28
- end
29
-
30
- class BusinessData
31
- # @return [String]
32
- attr_reader :name, :address, :city, :zipcode, :orig_key
33
-
34
- def initialize(name:, address:, city:, zipcode:, orig_key:)
35
- @name = name
36
- @address = address
37
- @city = city
38
- @zipcode = zipcode
39
- @orig_key = orig_key
40
- end
41
-
42
- def ==(other)
43
- @orig_key == other.orig_key
44
- end
45
-
46
- def eql?(other)
47
- self == other
48
- end
49
-
50
- def hash
51
- @orig_key.hash
52
- end
53
-
54
- # @return [String]
55
- def to_s
56
- "Business #{@orig_key}"
57
- end
58
- end
59
-
60
- class InspectionData
61
- # @return [String]
62
- attr_reader :orig_key, :business_orig_key, :score, :date
63
-
64
- def initialize(orig_key:, business_orig_key:, score:, date:)
65
- @orig_key = orig_key
66
- @business_orig_key = business_orig_key
67
- @score = score
68
- @date = date
69
- end
70
-
71
- def to_s
72
- "Inspection #{@orig_key}"
73
- end
74
- end
75
-
76
- class ViolationData
77
- # @return [String]
78
- attr_reader :orig_key, :inspection_id, :violation_kind_id
79
-
80
- def initialize(orig_key:, inspection_id:, violation_kind_id:)
81
- @orig_key = orig_key
82
- @inspection_id = inspection_id
83
- @violation_kind_id = violation_kind_id
84
- end
85
-
86
- def to_s
87
- "Violation #{@orig_key}"
88
- end
89
- end
90
-
91
- class ViolationKindData
92
- # @return [String]
93
- attr_reader :orig_key, :code, :demerits, :description
94
-
95
- def initialize(orig_key:, code:, demerits:, description:)
96
- @orig_key = orig_key
97
- @code = code
98
- @demerits = demerits
99
- @description = description
100
- end
101
-
102
- def to_s
103
- "ViolationKind #{@orig_key}"
104
- end
105
- end
106
-
107
- end
108
- end
109
- end