Class: Yamlt::Translator

Inherits:
Object
  • Object
show all
Defined in:
lib/yamlt/translator.rb

Instance Method Summary collapse

Constructor Details

#initialize(source_lang, target_lang) ⇒ Translator

Returns a new instance of Translator


8
9
10
11
# File 'lib/yamlt/translator.rb', line 8

def initialize(source_lang, target_lang)
  @source_lang = source_lang
  @target_lang = target_lang
end

Instance Method Details

#translate(original, target = nil) ⇒ Object


13
14
15
16
17
18
19
# File 'lib/yamlt/translator.rb', line 13

def translate(original,target = nil)
  if respond_to?(:custom_translate)
    self.custom_translate(original, target)
  else
    original
  end
end