Class: SoapyBing::Helpers::ZipDownloader

Inherits:
Object
  • Object
show all
Defined in:
lib/soapy_bing/helpers/zip_downloader.rb

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ ZipDownloader

Returns a new instance of ZipDownloader.



8
9
10
# File 'lib/soapy_bing/helpers/zip_downloader.rb', line 8

def initialize(url)
  @url = url
end

Instance Method Details

#readObject



12
13
14
15
16
17
# File 'lib/soapy_bing/helpers/zip_downloader.rb', line 12

def read
  Zip::InputStream.open(download_io) do |archive_io|
    file_io = archive_io.get_next_entry.get_input_stream
    file_io.read
  end
end