Module: Steam::Player
- Defined in:
- lib/steam-api/steam/player.rb
Overview
A Ruby DSL for communicating with the Steam Web API.
Class Method Summary collapse
-
.badges(steamid) ⇒ Object
Get a player’s Steam badges.
- .client ⇒ Object
-
.community_badge_progress(steamid) ⇒ Object
Get a player’s Steam Level.
-
.owned_games(steamid, params: {}) ⇒ Object
Get Owned Games.
-
.recently_played_games(steamid, params: {}) ⇒ Object
Get Recently Played Games.
-
.steam_level(steamid) ⇒ Object
Get a player’s Steam Level.
Class Method Details
.badges(steamid) ⇒ Object
Get a player’s Steam badges
53 54 55 56 57 |
# File 'lib/steam-api/steam/player.rb', line 53 def self.badges(steamid) response = client.get 'GetBadges/v1', params: { steamid: steamid } response.parse_key('response') end |
.client ⇒ Object
69 70 71 |
# File 'lib/steam-api/steam/player.rb', line 69 def self.client build_client 'IPlayerService' end |
.community_badge_progress(steamid) ⇒ Object
Get a player’s Steam Level
62 63 64 65 66 67 |
# File 'lib/steam-api/steam/player.rb', line 62 def self.community_badge_progress(steamid) response = client.get 'GetCommunityBadgeProgress/v1', params: { steamid: steamid } response.parse_key('response') .parse_key('quests') end |
.owned_games(steamid, params: {}) ⇒ Object
Get Owned Games
20 21 22 23 24 |
# File 'lib/steam-api/steam/player.rb', line 20 def self.owned_games(steamid, params: {}) params[:steamid] = steamid response = client.get 'GetOwnedGames/v1', params: params response.parse_key('response') end |
.recently_played_games(steamid, params: {}) ⇒ Object
Get Recently Played Games
33 34 35 36 37 38 |
# File 'lib/steam-api/steam/player.rb', line 33 def self.recently_played_games(steamid, params: {}) params[:steamid] = steamid response = client.get 'GetRecentlyPlayedGames/v1', params: params response.parse_key('response') end |
.steam_level(steamid) ⇒ Object
Get a player’s Steam Level
43 44 45 46 47 48 |
# File 'lib/steam-api/steam/player.rb', line 43 def self.steam_level(steamid) response = client.get 'GetSteamLevel/v1', params: { steamid: steamid } response.parse_key('response') .parse_key('player_level') end |