class MavisCLI::LocalAuthorities::DownloadPostcodeMappings
Public Instance Methods
Source
# File app/lib/mavis_cli/local_authorities/download_postcode_mappings.rb, line 17 def call url = "https://www.arcgis.com/sharing/rest/content/items/7fc55d71a09d4dcfa1fd6473138aacc3/data" file_name = "ons-postcode-to-la-mappings.zip" puts "Downloading Postcode to Local Authority Best-Fit mappings from ONS" target_path = File.expand_path(File.join("db/data/", file_name)) zip_data = Faraday.get(url).body bytes = File.write(target_path, zip_data) puts "#{bytes} bytes" end