Class: Oddb2xml::MedregbmDownloader

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

Instance Attribute Summary

Attributes inherited from Downloader

#agent, #type

Instance Method Summary collapse

Methods inherited from Downloader

#init

Constructor Details

#initialize(type = :company) ⇒ MedregbmDownloader

Returns a new instance of MedregbmDownloader.



162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/oddb2xml/downloader.rb', line 162

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



175
176
177
# File 'lib/oddb2xml/downloader.rb', line 175

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