Class: Arxiv::Downloader::PDF

Inherits:
Object
  • Object
show all
Defined in:
lib/arxiv/downloader/pdf.rb

Instance Method Summary collapse

Constructor Details

#initialize(identifier, client:) ⇒ PDF

Returns a new instance of PDF.



4
5
6
7
# File 'lib/arxiv/downloader/pdf.rb', line 4

def initialize identifier, client:
  @identifier = identifier
  @client     = client
end

Instance Method Details

#download(to:) ⇒ Object



9
10
11
# File 'lib/arxiv/downloader/pdf.rb', line 9

def download to:
  File.binwrite to, @client.get(url).to_s
end