Class: Warcraft::ApiRequest
- Inherits:
-
Object
- Object
- Warcraft::ApiRequest
- Defined in:
- lib/warcraft/api_request.rb
Direct Known Subclasses
Warcraft::Account::Profile, AccountRequest, CharacterRequest
Instance Method Summary collapse
- #get(url, region: nil, token: nil, namespace: "profile-#{region}") ⇒ Object
-
#initialize(client, region) ⇒ ApiRequest
constructor
A new instance of ApiRequest.
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 |