Module: Steam::Apps
- Defined in:
- lib/steam-api/steam/apps.rb
Overview
A Ruby DSL for communicating with the Apps portion of the Steam Web API.
Class Method Summary collapse
- .client ⇒ Object
-
.get_all ⇒ Hash
Get Steam Applications.
-
.get_servers(addr: nil, api_version: 'v1') ⇒ Hash
Get Servers at Address.
-
.up_to_date(appid: nil, version: 'v1', api_version: 'v1') ⇒ Hash
Check if a given version of an App is current.
Class Method Details
.client ⇒ Object
43 44 45 |
# File 'lib/steam-api/steam/apps.rb', line 43 def self.client build_client 'ISteamApps' end |
.get_all ⇒ Hash
Get Steam Applications
10 11 12 13 14 15 |
# File 'lib/steam-api/steam/apps.rb', line 10 def self.get_all response = client.get('GetApplist/v2') .parse_key('applist') .parse_key('apps') response end |
.get_servers(addr: nil, api_version: 'v1') ⇒ Hash
Get Servers at Address
21 22 23 24 25 26 27 |
# File 'lib/steam-api/steam/apps.rb', line 21 def self.get_servers(addr: nil, api_version: 'v1') response = client.get "GetServersAtAddress/#{api_version}", params: { addr: ERB::Util.url_encode(addr) } response = response.parse_key('response') response.check_success response.parse_key('servers') end |
.up_to_date(appid: nil, version: 'v1', api_version: 'v1') ⇒ Hash
Check if a given version of an App is current
34 35 36 37 38 39 40 41 |
# File 'lib/steam-api/steam/apps.rb', line 34 def self.up_to_date(appid: nil, version: 'v1', api_version: 'v1') response = client.get "UpToDateCheck/#{api_version}", params: { appid: appid, version: version } response = response.parse_key('response') response.check_success response.delete('success') response end |