Class: DeepL::Resources::TranslationMemory

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

Instance Attribute Summary collapse

Attributes inherited from Base

#request, #response

Instance Method Summary collapse

Constructor Details

#initialize(translation_memory, *args) ⇒ TranslationMemory

Returns a new instance of TranslationMemory.



11
12
13
14
15
16
17
18
# File 'lib/deepl/resources/translation_memory.rb', line 11

def initialize(translation_memory, *args)
  super(*args)
  @translation_memory_id = translation_memory['translation_memory_id']
  @name = translation_memory['name']
  @source_language = translation_memory['source_language']
  @target_languages = translation_memory['target_languages'] || []
  @segment_count = translation_memory['segment_count'] || 0
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/deepl/resources/translation_memory.rb', line 9

def name
  @name
end

#segment_countObject (readonly)

Returns the value of attribute segment_count.



9
10
11
# File 'lib/deepl/resources/translation_memory.rb', line 9

def segment_count
  @segment_count
end

#source_languageObject (readonly)

Returns the value of attribute source_language.



9
10
11
# File 'lib/deepl/resources/translation_memory.rb', line 9

def source_language
  @source_language
end

#target_languagesObject (readonly)

Returns the value of attribute target_languages.



9
10
11
# File 'lib/deepl/resources/translation_memory.rb', line 9

def target_languages
  @target_languages
end

#translation_memory_idObject (readonly)

Returns the value of attribute translation_memory_id.



9
10
11
# File 'lib/deepl/resources/translation_memory.rb', line 9

def translation_memory_id
  @translation_memory_id
end

Instance Method Details

#to_sObject



20
21
22
# File 'lib/deepl/resources/translation_memory.rb', line 20

def to_s
  "#{translation_memory_id} - #{name}"
end