Class: Downloader

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

Instance Method Summary collapse

Instance Method Details

#download(uri, local_path) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/io/downloader.rb', line 4

def download(uri, local_path)
  File.open(local_path, 'wb') do |saved_file|
    open(uri, 'rb') do |read_file|
      saved_file.write(read_file.read)
    end
  end
  local_path
end