class Oddb2xml::MedregbmDownloader

Public Class Methods

new(type = :company) click to toggle source
Calls superclass method Oddb2xml::Downloader::new
# File lib/oddb2xml/downloader.rb, line 192
def initialize(type = :company)
  @type = type
  action = case @type
  when :company # betrieb
    "CreateExcelListBetriebs"
  when :person # medizinalperson
    "CreateExcelListMedizinalPersons"
  else
    ""
  end
  url = "https://www.medregbm.admin.ch/Publikation/#{action}"
  super({}, url)
end

Public Instance Methods

download() click to toggle source
# File lib/oddb2xml/downloader.rb, line 206
def download
  file = "medregbm_#{@type}.txt"
  download_as(file, "w+:iso-8859-1:utf-8")
  report_download(@url, file)
  FileUtils.rm_f(file, verbose: true) # we need it only in the download
  file
end