class DiabloApi::Career
Attributes
battle_tag[R]
data[R]
locale[R]
region[R]
Public Class Methods
new(region, locale, battle_tag)
click to toggle source
# File lib/diablo_api/career.rb, line 13 def initialize(region, locale, battle_tag) @region = region @locale = locale @battle_tag = battle_tag fetch end
Private Instance Methods
build_url()
click to toggle source
# File lib/diablo_api/career.rb, line 26 def build_url "https://#{@region}.api.battle.net/d3/profile/#{URI.escape(@battle_tag)}/?locale=#{@locale}&apikey=#{DiabloApi::Config.configuration.api_key}" end
fetch()
click to toggle source
# File lib/diablo_api/career.rb, line 22 def fetch @data = convert_hash_keys(JSON.load(open(build_url).read)) end