module Shrine::ClassMethods

Defined in:

shrine.cr

Instance Method Summary

Instance Method Detail

def cache(io, **options) #

[View source]
def find_storage(name : String) #

Retrieves the storage under the given identifier (Symbol), raising Shrine::Error if the storage is missing.


[View source]
def raise_if_missing_settings! #

[View source]
def store(io, **options) #

[View source]
def upload(io, storage, **options) #

Uploads the file to the specified storage. It delegates to Shrine#upload.

Shrine.upload(io, :store) # => #<Shrine::UploadedFile>

[View source]
def uploaded_file(hash : Hash(String, String | UploadedFile::MetadataType)) #

[View source]
def uploaded_file(json : String) #

[View source]
def uploaded_file(object : UploadedFile) #

[View source]
def warn(message) #

Prints a warning to the logger.


[View source]
def with_file(io : IO, &) #

Temporarily converts an IO-like object into a file. If the input IO object is already a file, it simply yields it to the block, otherwise it copies IO content into a Tempfile object which is then yielded and afterwards deleted.

Shrine.with_file(io) { |file| file.path }

[View source]
def with_file(uploaded_file : UploadedFile, &) #

[View source]