Class: Eaternet::Agencies::Lives2
Instance Method Summary
collapse
#convert, #csv_map, #csv_rows, #map_csv, #try_to_create, #zip_dir
Methods included from Loggable
#logger
#legends
Constructor Details
#initialize(feed_url:, municipality_name:, municipality_url:, contact_email:) ⇒ Lives2
Returns a new instance of Lives2.
15
16
17
18
19
20
|
# File 'lib/eaternet/agencies/lives2.rb', line 15
def initialize(feed_url:, municipality_name:, municipality_url:, contact_email:)
@feed_url = feed_url
@municipality_name = municipality_name
@municipality_url = municipality_url
@contact_email = contact_email
end
|
Instance Method Details
#adapter_name ⇒ Object
44
45
46
|
# File 'lib/eaternet/agencies/lives2.rb', line 44
def adapter_name
@municipality_name
end
|
#businesses ⇒ Object
22
23
24
|
# File 'lib/eaternet/agencies/lives2.rb', line 22
def businesses
convert csv: 'businesses.csv', to_type: :business
end
|
#feed_info ⇒ Object
34
35
36
37
38
39
40
41
42
|
# File 'lib/eaternet/agencies/lives2.rb', line 34
def feed_info
Eaternet::Lives_1_0::FeedInfo.new do |fi|
fi.feed_date = Date.today
fi.feed_version = '2.0'
fi.municipality_name = @municipality_name
fi.municipality_url = @municipality_url
fi.contact_email = @contact_email
end
end
|
#inspections ⇒ Object
26
27
28
|
# File 'lib/eaternet/agencies/lives2.rb', line 26
def inspections
convert csv: 'inspections.csv', to_type: :inspection
end
|
#violations ⇒ Object
30
31
32
|
# File 'lib/eaternet/agencies/lives2.rb', line 30
def violations
convert csv: 'violations.csv', to_type: :violation
end
|
#zip_file_url ⇒ Object
48
49
50
|
# File 'lib/eaternet/agencies/lives2.rb', line 48
def zip_file_url
@feed_url
end
|