class OxfordDictionary::Endpoints::Translations

Interface for the /translations endpoint

API documentation can be found here: developer.oxforddictionaries.com/documentation

Constants

ENDPOINT

Public Instance Methods

translation(word:, source_language:, target_language:, params: {}) click to toggle source
# File lib/oxford_dictionary/endpoints/translations.rb, line 12
def translation(word:, source_language:, target_language:, params: {})
  path = "#{ENDPOINT}/#{source_language}/#{target_language}/#{word}"
  uri = request_uri(path: path, params: params)

  response = @request_client.get(uri: uri)
  deserialize.call(response.body)
end