Class: Shrine::Derivation::Opened

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

#callObject

Returns opened Shrine::UploadedFile object pointing to the uploaded if it exists on the storage.


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

def call
  uploaded_file = shrine_class.uploaded_file(storage: upload_storage, id: upload_location)
  uploaded_file.open(**upload_open_options)
  uploaded_file
rescue Shrine::FileNotFound
end