Class: Oddb2xml::RefdataDownloader

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

Instance Attribute Summary

Attributes inherited from Downloader

#agent, #file2save, #type, #url

Instance Method Summary collapse

Methods inherited from Downloader

#report_download

Constructor Details

#initialize(options = {}, type = :pharma) ⇒ RefdataDownloader

Returns a new instance of RefdataDownloader.



246
247
248
249
# File 'lib/oddb2xml/downloader.rb', line 246

def initialize(options = {}, type = :pharma)
  url = "https://files.refdata.ch/simis-public-prod/Articles/1.0/Refdata.Articles.zip"
  super(options, url)
end

Instance Method Details

#downloadObject



255
256
257
258
259
260
# File 'lib/oddb2xml/downloader.rb', line 255

def download
  filename = "Refdata.Articles.zip"
  download_as(filename, "w+")
  content = read_xml_from_zip(/Refdata.Articles.xml/, File.join(DOWNLOADS, filename))
  content
end

#initObject



251
252
253
# File 'lib/oddb2xml/downloader.rb', line 251

def init
  # No SOAP client needed - we download a zip file directly
end