class Shrine::Plugins::DownloadEndpoint::FileUrl

  1. lib/shrine/plugins/download_endpoint.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. call
  2. file

Attributes

file [R]

Public Class methods

new(file)
[show source]
   # File lib/shrine/plugins/download_endpoint.rb
67 def initialize(file)
68   @file = file
69 end

Public Instance methods

call(host: self.host, expires_in: nil)
[show source]
   # File lib/shrine/plugins/download_endpoint.rb
71 def call(host: self.host, expires_in: nil)
72   path = file.urlsafe_dump(metadata: %w[filename size mime_type])
73 
74   query = signature_as_query(path: path, expires_in: expires_in)
75 
76   path = [host, *prefix, path].join("/")
77   path += "?#{query}" if query
78   path
79 end