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.



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

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



260
261
262
263
264
265
# File 'lib/oddb2xml/downloader.rb', line 260

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



250
251
252
253
254
255
256
257
258
# File 'lib/oddb2xml/downloader.rb', line 250

def init
  config = {
    log_level: :info,
    log: false, # $stdout
    raise_errors: true,
    wsdl: @url
  }
  @client = Savon::Client.new(config)
end