module Steam::Apps

A Ruby DSL for communicating with the Apps portion of the Steam Web API. @see developer.valvesoftware.com/wiki/Steam_Web_API @since 1.0.0

Public Class Methods

client() click to toggle source
# File lib/steam-api/steam/apps.rb, line 43
def self.client
  build_client 'ISteamApps'
end
get_all() click to toggle source

Get Steam Applications @return [Hash] A list of objects containing the title and app ID of

each program available in the store.

@see wiki.teamfortress.com/wiki/WebAPI/GetAppList

# 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') click to toggle source

Get Servers at Address @param [String] addr IP or IP:queryport to list @return [Hash] A hash containing the API response @see wiki.teamfortress.com/wiki/WebAPI/GetServersAtAddress

# 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') click to toggle source

Check if a given version of an App is current @param [Fixnum] appid AppID of game @param [Fixnum] version The installed version of the game @return [Hash] A hash containing the API response @see wiki.teamfortress.com/wiki/WebAPI/UpToDateCheck

# 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