class Eve::Api::Client::Xml

Constants

KEY_ID
ROOT_URL
VERIFICATION_CODE

Public Class Methods

new() click to toggle source
# File lib/eve/api/client/xml.rb, line 11
def initialize
  key_id = KEY_ID
  verification_code = VERIFICATION_CODE
  @creds = { keyID: key_id, vcode: verification_code }
end

Public Instance Methods

get(url) click to toggle source
# File lib/eve/api/client/xml.rb, line 17
def get(url)
  url_string = "#{Xml::ROOT_URL}#{url}?#{encoded_params}"
  puts "GET: #{url_string}"
  response = HTTParty.get(url_string)

  begin
    response["eveapi"]["result"]
  rescue
    raise "Could not process Response"
  end
end

Private Instance Methods

encoded_params() click to toggle source
# File lib/eve/api/client/xml.rb, line 31
def encoded_params
  @encoded_creds ||= URI.encode_www_form(@creds)
end