Class: DeepL::Resources::TranslationMemoryExport

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

Overview

A translation memory export job. Poll the job until it is finished to obtain the download URL of the exported TMX file.

Instance Attribute Summary collapse

Attributes inherited from Base

#request, #response

Instance Method Summary collapse

Constructor Details

#initialize(translation_memory_export, reused_existing, *args) ⇒ TranslationMemoryExport

Returns a new instance of TranslationMemoryExport.



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

def initialize(translation_memory_export, reused_existing, *args)
  super(*args)
  parameters = translation_memory_export['parameters'] || {}
  @job_id = translation_memory_export['job_id']
  @translation_memory_id = parameters['translation_memory_id']
  @reused_existing = reused_existing
end

Instance Attribute Details

#job_idObject (readonly)

Returns the value of attribute job_id.



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

def job_id
  @job_id
end

#translation_memory_idObject (readonly)

Returns the value of attribute translation_memory_id.



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

def translation_memory_id
  @translation_memory_id
end

Instance Method Details

#reused_existing?true

Checks if the API reused a previously completed export instead of starting a new one.

Returns:

  • (true)

    if so



28
29
30
# File 'lib/deepl/resources/translation_memory_export.rb', line 28

def reused_existing?
  @reused_existing
end

#to_sObject



32
33
34
# File 'lib/deepl/resources/translation_memory_export.rb', line 32

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