Class: YandexDictionary::YandexDictionaryApi

Inherits:
Object
  • Object
show all
Defined in:
lib/yandex_dictionary/yandex_dictionary_api.rb

Class Method Summary collapse

Class Method Details

.get_directionsObject



5
6
7
8
# File 'lib/yandex_dictionary/yandex_dictionary_api.rb', line 5

def self.get_directions
  params = {:key => Secrets.API_KEY}
  return YandexDictionaryRequest.make_request("getLangs", params);
end

.translate(text, from, to) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/yandex_dictionary/yandex_dictionary_api.rb', line 10

def self.translate(text, from, to)
  lang = "#{from}-#{to}"

  params = {:key => Secrets.API_KEY,
  :text => text,
  :lang => lang
  }

  return YandexDictionaryRequest.make_request("lookup", params)
end