Class: Eaternet::Agencies::Sf

Inherits:
Lives_1_0::Adapter show all
Includes:
Lives_1_0::CsvParser, Loggable
Defined in:
lib/eaternet/agencies/sf.rb

Instance Method Summary collapse

Methods included from Lives_1_0::CsvParser

#convert, #csv_map, #csv_rows, #map_csv, #try_to_create, #zip_dir

Methods included from Loggable

#logger

Methods inherited from Lives_1_0::Adapter

#legends

Instance Method Details

#adapter_nameObject



37
38
39
# File 'lib/eaternet/agencies/sf.rb', line 37

def adapter_name
  'SF'
end

#businessesObject



15
16
17
# File 'lib/eaternet/agencies/sf.rb', line 15

def businesses
  convert csv: 'businesses.csv', to_type: :business
end

#feed_infoObject



27
28
29
30
31
32
33
34
35
# File 'lib/eaternet/agencies/sf.rb', line 27

def feed_info
  Eaternet::Lives_1_0::FeedInfo.new do |fi|
    fi.feed_date =         Date.today
    fi.feed_version =      '1.0'
    fi.municipality_name = 'San Francisco'
    fi.municipality_url =  'https://www.sfdph.org/dph/EH/Food/Score/default.asp'
    fi.contact_email =     '[email protected]'
  end
end

#inspectionsObject



19
20
21
# File 'lib/eaternet/agencies/sf.rb', line 19

def inspections
  convert csv: 'inspections.csv', to_type: :inspection
end

#violationsObject



23
24
25
# File 'lib/eaternet/agencies/sf.rb', line 23

def violations
  convert csv: 'violations.csv', to_type: :violation
end

#zip_file_urlObject



41
42
43
# File 'lib/eaternet/agencies/sf.rb', line 41

def zip_file_url
  'https://extxfer.sfdph.org/food/SFBusinesses.zip'
end