Class: Google::Translator
- Inherits:
-
Object
- Object
- Google::Translator
- Defined in:
- lib/yaml_translate/translator.rb
Instance Method Summary collapse
-
#translate(from, to, from_text, options = {}) ⇒ Object
Calling the original method while gracefully return a string on any error despite an Interrupt.
- #translate_original ⇒ Object
Instance Method Details
#translate(from, to, from_text, options = {}) ⇒ Object
Calling the original method while gracefully return a string on any error despite an Interrupt
10 11 12 13 14 15 16 17 18 |
# File 'lib/yaml_translate/translator.rb', line 10 def translate from, to, from_text, ={} begin translate_original from, to, from_text, rescue Interrupt exit 1 rescue Exception => e ["[FAIL] #{from_text}", ''] end end |
#translate_original ⇒ Object
7 |
# File 'lib/yaml_translate/translator.rb', line 7 alias_method :translate_original, :translate |