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, **options) ⇒ 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, **options) ⇒ 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.
644 645 646 647 648 649 650 |
# File 'lib/shrine/plugins/derivation_endpoint.rb', line 644 def call(derivative = nil, **) if derivative upload(derivative, **) else upload(derivation.generate, delete: true, **) end end |