Class: Portal2Stats
- Defined in:
- lib/steam/community/portal2/portal2_stats.rb
Overview
This class represents the game statistics for a single user in Portal 2
Instance Attribute Summary
Attributes inherited from GameStats
#game, #hours_played, #privacy_state, #user
Instance Method Summary collapse
-
#initialize(steam_id, fetch = true, bypass_cache = false) ⇒ Portal2Stats
constructor
Creates a ‘Portal2Stats` object by calling the super constructor with the game name `’portal2’‘.
-
#inventory ⇒ Portal2Inventory
Returns the current Portal 2 inventory (a.k.a Robot Enrichment) of this player.
Methods inherited from GameStats
#achievements, #achievements_done, #achievements_percentage, base_url, #base_url, create_game_stats, #public?
Methods included from XMLData
Constructor Details
#initialize(steam_id, fetch = true, bypass_cache = false) ⇒ Portal2Stats
Creates a ‘Portal2Stats` object by calling the super constructor with the game name `’portal2’‘
20 21 22 |
# File 'lib/steam/community/portal2/portal2_stats.rb', line 20 def initialize(steam_id) super steam_id, 'portal2' end |
Instance Method Details
#inventory ⇒ Portal2Inventory
Returns the current Portal 2 inventory (a.k.a Robot Enrichment) of this player
28 29 30 31 |
# File 'lib/steam/community/portal2/portal2_stats.rb', line 28 def inventory @inventory = Portal2Inventory.new(user.steam_id64) if @inventory.nil? @inventory end |