Class: Vapor::API

Inherits:
Object
  • Object
show all
Defined in:
lib/vapor/api.rb

Constant Summary collapse

BASE_URL =
"http://api.steampowered.com"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



15
16
17
# File 'lib/vapor/api.rb', line 15

def client
  @client
end

Class Method Details

.keyObject



6
7
8
# File 'lib/vapor/api.rb', line 6

def key
  @key ||= ENV['STEAM_API_KEY']
end

.key=(key) ⇒ Object



10
11
12
# File 'lib/vapor/api.rb', line 10

def key=(key)
  @key = key
end

Instance Method Details

#player_summaries_for(user) ⇒ Object



17
18
19
# File 'lib/vapor/api.rb', line 17

def player_summaries_for(user)
  fetch('ISteamUser/GetPlayerSummaries', version: 'v0002', steamids: user.steam_id.to_s)
end