module Gamertag::Connection

@private

Public Instance Methods

get(path, params={}) click to toggle source
# File lib/gamertag/connection.rb, line 8
def get(path, params={})
  conn = Faraday.new(:url => endpoint_url) do |faraday|
    faraday.use Faraday::Response::RaiseXboxLeadersError
    faraday.use Faraday::Response::Mashify
    faraday.use Faraday::Response::ParseJson
    faraday.use Faraday::Response::CleanupXboxLeadersNaming

    faraday.adapter adapter
  end
  
  response = conn.get "/api/#{api_version}#{path}", params
  response.body
end