Class: ShvetsGoogleTranslate

Inherits:
TranslatorBase show all
Defined in:
lib/translators/shvets_google_translate.rb

Instance Method Summary collapse

Methods inherited from TranslatorBase

response_time

Instance Method Details

#translate(text, source, destination) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/translators/shvets_google_translate.rb', line 5

def translate(text, source, destination)
  result = text
  begin
    shvet_google = Google::Translator.new
    result = shvet_google.translate(source.to_sym, destination.to_sym, text)
  rescue
    # Just do nothing...
  ensure
    return result
  end
end