Class: Warcraft::ApiRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/warcraft/api_request.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, region) ⇒ ApiRequest

Returns a new instance of ApiRequest.



5
6
7
8
# File 'lib/warcraft/api_request.rb', line 5

def initialize(client, region)
  @client = client
  @region = region
end

Instance Method Details

#get(url, region: nil, token: nil, namespace: "profile-#{region}") ⇒ Object



10
11
12
13
# File 'lib/warcraft/api_request.rb', line 10

def get(url, region: nil, token: nil, namespace: "profile-#{region}")
  region ||= @region
  @client.get("#{url}?namespace=#{namespace}", region: region, token: token)
end