Module: Shrine::Plugins::Instrumentation::FileMethods

Defined in:
lib/shrine/plugins/instrumentation.rb

Instance Method Summary collapse

Instance Method Details

#deleteObject

Sends a ‘delete.shrine` event.



124
125
126
127
128
129
130
# File 'lib/shrine/plugins/instrumentation.rb', line 124

def delete
  shrine_class.instrument(
    :delete,
    storage: storage_key.to_sym,
    location: id,
  ) { super }
end

#exists?Boolean

Sends a ‘exists.shrine` event.

Returns:

  • (Boolean)


115
116
117
118
119
120
121
# File 'lib/shrine/plugins/instrumentation.rb', line 115

def exists?
  shrine_class.instrument(
    :exists,
    storage: storage_key.to_sym,
    location: id,
  ) { super }
end

#open(**options) ⇒ Object

Sends a ‘download.shrine` event.



105
106
107
108
109
110
111
112
# File 'lib/shrine/plugins/instrumentation.rb', line 105

def open(**options)
  shrine_class.instrument(
    :download,
    storage: storage_key.to_sym,
    location: id,
    download_options: options,
  ) { super }
end