Module: Shrine::Plugins::RemoteUrl::ClassMethods

Defined in:
lib/shrine/plugins/remote_url.rb

Instance Method Summary collapse

Instance Method Details

#remote_url(url, **options) ⇒ Object

Downloads the file using the “down” gem or a custom downloader. Checks the file size and terminates the download early if the file is too big.



55
56
57
58
59
60
61
# File 'lib/shrine/plugins/remote_url.rb', line 55

def remote_url(url, **options)
  options = { max_size: opts[:remote_url][:max_size] }.merge(options)

  instrument_remote_url(url, options) do
    download_remote_url(url, options)
  end
end