Class: DeepL::Requests::TranslationMemory::StorageBase

Inherits:
Base
  • Object
show all
Defined in:
lib/deepl/requests/translation_memory/storage_base.rb

Overview

Common behaviour of the requests to a pre-signed storage URL handed out by the API, such as a translation memory upload or download URL. Those URLs point outside of the DeepL API, so they are requested over their own connection and the DeepL Authorization header is deliberately not sent.

Direct Known Subclasses

DownloadExport, UploadFile

Constant Summary

Constants inherited from Base

Base::MAX_GLOSSARY_IDS

Instance Attribute Summary collapse

Attributes inherited from Base

#api, #options, #response

Instance Method Summary collapse

Methods inherited from Base

#details, #request

Constructor Details

#initialize(api, storage_url, options = {}, additional_headers = {}) ⇒ StorageBase

Returns a new instance of StorageBase.



18
19
20
21
22
23
24
25
# File 'lib/deepl/requests/translation_memory/storage_base.rb', line 18

def initialize(api, storage_url, options = {}, additional_headers = {})
  super(api, options, additional_headers)
  if storage_url.nil? || storage_url.empty?
    raise Exceptions::Error, 'Storage URL must not be empty'
  end

  @storage_url = storage_url
end

Instance Attribute Details

#storage_urlObject (readonly)

Returns the value of attribute storage_url.



16
17
18
# File 'lib/deepl/requests/translation_memory/storage_base.rb', line 16

def storage_url
  @storage_url
end