class NerdTown::Configuration

Attributes

api_key[RW]

Public Instance Methods

http_connection() click to toggle source
# File lib/nerd_town.rb, line 18
def http_connection
  @connection ||= Faraday.new(url: 'https://us.api.battle.net/wow/',
                               params: {apikey: self.api_key,
                                        locale: 'en_US'}) do |faraday|
    faraday.request :url_encoded
    faraday.request :json

    faraday.response :json
    faraday.adapter Faraday.default_adapter
  end
end