Method: Refile::Attacher#download

Defined in:
lib/refile/attacher.rb

#download(url) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



53
54
55
56
57
58
59
60
# File 'lib/refile/attacher.rb', line 53

def download(url)
  if url and not url == ""
    cache!(RestClient::Request.new(method: :get, url: url, raw_response: true).execute.file)
  end
rescue RestClient::Exception
  @errors = [:download_failed]
  raise if @raise_errors
end