Module: Shrine::Plugins::RemoteUrl::ClassMethods
- Defined in:
- lib/shrine/plugins/remote_url.rb
Instance Method Summary collapse
-
#remote_url(url, **options) ⇒ Object
Downloads the file using the “down” gem or a custom downloader.
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.
37 38 39 40 41 42 43 |
# File 'lib/shrine/plugins/remote_url.rb', line 37 def remote_url(url, **) = { max_size: opts[:remote_url][:max_size] }.merge() instrument_remote_url(url, ) do opts[:remote_url][:downloader].call(url, ) end end |