Class: Shrine::Derivation::Upload

Inherits:
Command
  • Object
show all
Defined in:
lib/shrine/plugins/derivation_endpoint.rb

Instance Attribute Summary

Attributes inherited from Command

#derivation

Instance Method Summary collapse

Methods inherited from Command

delegate, #initialize

Constructor Details

This class inherits a constructor from Shrine::Derivation::Command

Instance Method Details

#call(derivative = nil) ⇒ Object

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.



680
681
682
683
684
685
686
# File 'lib/shrine/plugins/derivation_endpoint.rb', line 680

def call(derivative = nil)
  with_derivative(derivative) do |uploadable|
    uploader.upload uploadable,
      location:       upload_location,
      upload_options: upload_options
  end
end