Commit af98f67a authored by Francis's avatar Francis
Browse files

Fixed account profile endpoints

parent 25e83f33
Pipeline #123430340 failed with stage
in 58 seconds
Please view this file on the master branch, otherwise it may be outdated
**Version 0.3.4**
Fixed account endpoints
**Version 0.3.3**
Added character profile encounter endpoints:
......
......@@ -2,5 +2,5 @@
module BlizzardApi
# Gem version
VERSION = '0.3.3'
VERSION = '0.3.4'
end
......@@ -258,7 +258,7 @@ module BlizzardApi
#
# @return {Profile}
def self.profile(token)
BlizzardApi::Wow::Profile.new(token)
BlizzardApi::Wow::AccountProfile.new(token)
end
##
......
......@@ -7,7 +7,8 @@ module BlizzardApi
class AccountProfile < Request
##
# @param token [String] A token obtained using the authorization_code flow
def initialize(token)
def initialize(token, region = nil)
super region
@token = token
end
......@@ -17,8 +18,8 @@ module BlizzardApi
# @!macro request_options
#
# @!macro response
def get(_options = {})
api_request base_url(:user_profile).to_s
def get(options = {})
api_request base_url(:user_profile).to_s, default_options.merge(options)
end
##
......@@ -67,8 +68,9 @@ module BlizzardApi
{ ttl: CACHE_HOUR, namespace: :profile }
end
def api_request(_uri, query_string = nil)
query_string[:access_token] = @token
def api_request(_uri, query_string = {})
query_string.merge! access_token: @token
super
end
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment