class

ActiveStorage::Service

Inherits Reference < Object

Port of ActiveStorage::Service (the gem's abstract service API).

Constructors

new(name : String)

Registry name (the key under storage.yml / Blob.services).

Source

Instance methods

delete(key : String) : Nil
Source
download(key : String) : String
Source
exist?(key : String) : Bool
Source
headers_for_direct_upload(key : String, content_type : String | Nil, content_length : Int64, checksum : String | Nil, filename : String | Nil = nil) : Hash(String, String)

Headers the client must send with the direct-upload request.

Source
name
Source
upload(key : String, data : String | Bytes, checksum : String | Nil = nil, content_type : String | Nil = nil) : Nil
Source
url(key : String, expires_in : Int32 = 300, disposition : String | Nil = nil, filename : String | Nil = nil, content_type : String | Nil = nil) : String

Presigned/public URL; the Disk service needs the app's routes and raises instead (the gem routes through the redirect controller).

Source
url_for_direct_upload(key : String, expires_in : Int32, content_type : String | Nil, content_length : Int64, checksum : String | Nil) : String

URL the client directly uploads the file to. Overridden by the concrete services (Disk: verifier token; S3: presigned PUT).

Source