Class: Eaternet::Lives_1_0::Inspection
- Inherits:
-
ValidatedObject
- Object
- ValidatedObject
- Eaternet::Lives_1_0::Inspection
- Defined in:
- lib/eaternet/lives_1_0/inspection.rb
Overview
Information about an inspectors’ visit to a businesses.
Constant Summary collapse
- ZERO_TO_ONE_HUNDRED_AND_BLANK =
(0..100).to_a + ['']
Instance Attribute Summary collapse
-
#business_id ⇒ String
Unique identifier of the business for which this inspection was done.
-
#date ⇒ Date
Date of the inspection.
-
#description ⇒ String
Single line description containing details on the outcome of an inspection.
-
#score ⇒ Integer, String
Inspection score on a 0-100 scale.
-
#type ⇒ String
String representing the type of inspection.
Instance Method Summary collapse
Methods inherited from ValidatedObject
#check_validations!, #initialize
Constructor Details
This class inherits a constructor from Eaternet::ValidatedObject
Instance Attribute Details
#business_id ⇒ String
Unique identifier of the business for which this inspection was done.
17 18 19 |
# File 'lib/eaternet/lives_1_0/inspection.rb', line 17 def business_id @business_id end |
#date ⇒ Date
Date of the inspection.
43 44 45 |
# File 'lib/eaternet/lives_1_0/inspection.rb', line 43 def date @date end |
#description ⇒ String
Single line description containing details on the outcome of an inspection. Use of this field is only encouraged if no violations are provided.
52 53 54 |
# File 'lib/eaternet/lives_1_0/inspection.rb', line 52 def description @description end |
#score ⇒ Integer, String
Inspection score on a 0-100 scale. 100 is the highest score. This column must always be present in inspections.csv. However, it can be safely left blank for inspection rows that don’t have an associated score. (For example, some municipalities don’t associate a follow-up inspection with a score.)
30 31 32 |
# File 'lib/eaternet/lives_1_0/inspection.rb', line 30 def score @score end |
#type ⇒ String
String representing the type of inspection. Must be (initial, routine, followup, complaint).
59 60 61 |
# File 'lib/eaternet/lives_1_0/inspection.rb', line 59 def type @type end |
Instance Method Details
#==(other) ⇒ Object
69 70 71 |
# File 'lib/eaternet/lives_1_0/inspection.rb', line 69 def ==(other) business_id == other.business_id && date == other.date end |
#eql?(other) ⇒ Boolean
73 74 75 |
# File 'lib/eaternet/lives_1_0/inspection.rb', line 73 def eql?(other) self == other end |
#hash ⇒ Object
77 78 79 |
# File 'lib/eaternet/lives_1_0/inspection.rb', line 77 def hash "#{business_id} #{date}".hash end |
#to_s ⇒ String
65 66 67 |
# File 'lib/eaternet/lives_1_0/inspection.rb', line 65 def to_s "Inspection #{business_id}/#{date}/#{score}" end |