Sha256: 558227047017cd5a6cf561ac307eba21322da5d0749ce197948c9bf6e9afdced

Contents?: true

Size: 472 Bytes

Versions: 2

Compression:

Stored size: 472 Bytes

Contents

require "base64"

module Notifications
  def self.prepare_upload(file, filename: nil, confirm_email_before_download: nil, retention_period: nil)
    raise ArgumentError.new("File is larger than 2MB") if file.size > Client::MAX_FILE_UPLOAD_SIZE

    data = { file: Base64.strict_encode64(file.read) }

    data[:filename] = filename
    data[:confirm_email_before_download] = confirm_email_before_download
    data[:retention_period] = retention_period

    data
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
notifications-ruby-client-6.2.0 lib/notifications/client/helper_methods.rb
notifications-ruby-client-6.0.0 lib/notifications/client/helper_methods.rb