module Shrine::Plugins::DownloadEndpoint

  1. lib/shrine/plugins/download_endpoint.rb

Documentation lives in doc/plugins/download_endpoint.md on GitHub.

Methods

Public Class

  1. configure
  2. load_dependencies

Public Class methods

configure (uploader, opts = {})
[show source]
   # File lib/shrine/plugins/download_endpoint.rb
14 def self.configure(uploader, opts = {})
15   uploader.opts[:download_endpoint] ||= { disposition: "inline", download_options: {} }
16   uploader.opts[:download_endpoint].merge!(opts)
17 
18   Shrine.deprecation("The :storages download_endpoint option is deprecated, you should use UploadedFile#download_url for generating URLs to the download endpoint.") if uploader.opts[:download_endpoint][:storages]
19 
20   uploader.assign_download_endpoint(App) unless uploader.const_defined?(:DownloadEndpoint)
21 end
load_dependencies (uploader, opts = {})
[show source]
   # File lib/shrine/plugins/download_endpoint.rb
 9 def self.load_dependencies(uploader, opts = {})
10   uploader.plugin :rack_response
11   uploader.plugin :_urlsafe_serialization
12 end