Class: Oddb2xml::MedregbmDownloader

Inherits:
Downloader show all
Includes:
DownloadMethod
Defined in:
lib/oddb2xml/downloader.rb

Instance Method Summary collapse

Methods inherited from Downloader

#init

Constructor Details

#initialize(type = :company) ⇒ MedregbmDownloader

Returns a new instance of MedregbmDownloader.



131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/oddb2xml/downloader.rb', line 131

def initialize(type=:company)
  @type = type
  case @type
  when :company # betrieb
    action = 'CreateExcelListBetriebs'
  when :person  # medizinalperson
    action = 'CreateExcelListMedizinalPersons'
  else
    action = ''
  end
  url = "https://www.medregbm.admin.ch/Publikation/#{action}"
  super({}, url)
end

Instance Method Details

#downloadObject



144
145
146
# File 'lib/oddb2xml/downloader.rb', line 144

def download
  download_as("medregbm_#{@type.to_s}.txt", 'r:iso-8859-1:utf-8')
end