class Yandex::Translate::Connect

Constants

BASE_URI

Public Class Methods

new(key) click to toggle source
# File lib/connect.rb, line 7
def initialize(key)
  @key = key
  @rv = Yandex::Translate::ResponseVerify.new
end

Public Instance Methods

get(type, data) click to toggle source
# File lib/connect.rb, line 12
def get(type, data)
  postfix = URI.encode_www_form(data)
  rep = JSON.parse(Net::HTTP.get(URI("#{BASE_URI}#{type}?key=#{@key}&#{postfix}")))
  return @rv.verify(rep)
end