Class: BrandEins::Downloader::PDFDownloader
- Inherits:
-
Object
- Object
- BrandEins::Downloader::PDFDownloader
- Defined in:
- lib/brandeins.rb
Instance Method Summary collapse
- #download_all ⇒ Object
-
#initialize(pdf_links, dl_dir) ⇒ PDFDownloader
constructor
A new instance of PDFDownloader.
Constructor Details
#initialize(pdf_links, dl_dir) ⇒ PDFDownloader
Returns a new instance of PDFDownloader.
115 116 117 118 |
# File 'lib/brandeins.rb', line 115 def initialize(pdf_links, dl_dir) @dl_dir = dl_dir @pdf_links = pdf_links end |
Instance Method Details
#download_all ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/brandeins.rb', line 120 def download_all pdf_files = Array.new @pdf_links.each do |pdf_link| pdf_name = @dl_dir + '/' + File.basename(pdf_link) pdf_url = pdf_link download_pdf(pdf_url, pdf_name) pdf_files << pdf_name end pdf_files end |