Class: DotaApiWrapper::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/dota_api_wrapper/base.rb

Direct Known Subclasses

Match, Player, Resource

Constant Summary collapse

BASE_URI =
'http://api.steampowered.com'.freeze
API_KEY =
ENV['STEAM_API_KEY']

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.retrieve_info(action, options = {}) ⇒ Object



12
13
14
15
# File 'lib/dota_api_wrapper/base.rb', line 12

def self.retrieve_info(action, options = {})
  query_params = { 'key' => API_KEY }.merge(options)
  get(action, query: query_params, headers: {})
end

Instance Method Details

#get(uri, options) ⇒ Object



8
9
10
# File 'lib/dota_api_wrapper/base.rb', line 8

def get(uri, options)
  self.class.get(uri, options)
end