Class: DeepL::Resources::TranslationMemoryImport

Inherits:
Base
  • Object
show all
Defined in:
lib/deepl/resources/translation_memory_import.rb

Overview

A newly created translation memory import job. The TMX file must be uploaded to upload_url before expires_at, processing starts once the upload is detected.

Instance Attribute Summary collapse

Attributes inherited from Base

#request, #response

Instance Method Summary collapse

Constructor Details

#initialize(translation_memory_import, *args) ⇒ TranslationMemoryImport

Returns a new instance of TranslationMemoryImport.



15
16
17
18
19
20
21
22
# File 'lib/deepl/resources/translation_memory_import.rb', line 15

def initialize(translation_memory_import, *args)
  super(*args)
  @job_id = translation_memory_import['job_id']
  @upload_url = translation_memory_import['upload_url']
  @expires_at = Utils::TimeParser.parse_optional_time(
    translation_memory_import['expires_at']
  )
end

Instance Attribute Details

#expires_atObject (readonly)

Returns the value of attribute expires_at.



13
14
15
# File 'lib/deepl/resources/translation_memory_import.rb', line 13

def expires_at
  @expires_at
end

#job_idObject (readonly)

Returns the value of attribute job_id.



13
14
15
# File 'lib/deepl/resources/translation_memory_import.rb', line 13

def job_id
  @job_id
end

#upload_urlObject (readonly)

Returns the value of attribute upload_url.



13
14
15
# File 'lib/deepl/resources/translation_memory_import.rb', line 13

def upload_url
  @upload_url
end

Instance Method Details

#to_sObject



24
25
26
# File 'lib/deepl/resources/translation_memory_import.rb', line 24

def to_s
  "TranslationMemoryImport: ID: #{job_id}"
end