class ActiveStorage::Service::CloudinaryService

def exist?(key)

def exist?(key)
  key = find_blob_or_use_key(key)
  instrument :exist, key: key do |payload|
    begin
      options = {
        resource_type: resource_type(nil, key),
        type: @options[:type]
      }.compact
      Cloudinary::Api.resource public_id(key), **options
      true
    rescue Cloudinary::Api::NotFound => e
      false
    end
  end
end