Class: Shrine::Derivation::Upload
- Defined in:
- lib/shrine/plugins/derivation_endpoint.rb
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
-
#call(derivative = nil) ⇒ Object
Uploads the derivation result to the dedicated location on the storage.
Methods inherited from Command
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: end end |