class Shrine::Derivation::Upload

  1. lib/shrine/plugins/derivation_endpoint.rb
Superclass: Command

Methods

Public Instance

  1. call

Public Instance methods

call(derivative = nil, **options)

Uploads the derivation result to the dedicated location on the storage. If a file object is given, uploads that to the storage, otherwise calls the derivation block and uploads the result.

[show source]
    # File lib/shrine/plugins/derivation_endpoint.rb
646 def call(derivative = nil, **options)
647   if derivative
648     upload(derivative, **options)
649   else
650     upload(derivation.generate, delete: true, **options)
651   end
652 end