Class: LightTr::Translator

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

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Translator

Returns a new instance of Translator.



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

def initialize(api_key)
  @api_key = api_key
end

Instance Method Details

#translate(query, target = 'en') ⇒ Object



13
14
15
# File 'lib/light_tr/translator.rb', line 13

def translate(query, target = 'en')
  extract_translation(request(query, target))
end