Class: DeepL::Resources::LanguagePair

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

Instance Attribute Summary collapse

Attributes inherited from Base

#request, #response

Instance Method Summary collapse

Constructor Details

#initialize(source_lang, target_lang, *args) ⇒ LanguagePair

Returns a new instance of LanguagePair.



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

def initialize(source_lang, target_lang, *args)
  super(*args)

  @source_lang = source_lang
  @target_lang = target_lang
end

Instance Attribute Details

#source_langObject (readonly)

Returns the value of attribute source_lang.



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

def source_lang
  @source_lang
end

#target_langObject (readonly)

Returns the value of attribute target_lang.



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

def target_lang
  @target_lang
end

Instance Method Details

#to_sObject



18
19
20
# File 'lib/deepl/resources/language_pair.rb', line 18

def to_s
  "#{source_lang} - #{target_lang}"
end