Module: Shrine::Plugins::Instrumentation::FileMethods
- Defined in:
- lib/shrine/plugins/instrumentation.rb
Instance Method Summary collapse
-
#delete ⇒ Object
Sends a ‘delete.shrine` event.
-
#exists? ⇒ Boolean
Sends a ‘exists.shrine` event.
-
#stream(destination, **options) ⇒ Object
Sends a ‘download.shrine` event.
Instance Method Details
#delete ⇒ Object
Sends a ‘delete.shrine` event.
119 120 121 122 123 124 125 |
# File 'lib/shrine/plugins/instrumentation.rb', line 119 def delete shrine_class.instrument( :delete, storage: storage_key, location: id, ) { super } end |
#exists? ⇒ Boolean
Sends a ‘exists.shrine` event.
110 111 112 113 114 115 116 |
# File 'lib/shrine/plugins/instrumentation.rb', line 110 def exists? shrine_class.instrument( :exists, storage: storage_key, location: id, ) { super } end |
#stream(destination, **options) ⇒ Object
Sends a ‘download.shrine` event.
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/shrine/plugins/instrumentation.rb', line 98 def stream(destination, **) return super if opened? shrine_class.instrument( :download, storage: storage_key, location: id, download_options: , ) { super(destination, **, instrument: false) } end |