Class: Portal2Stats

Inherits:
GameStats show all
Defined in:
lib/steam/community/portal2/portal2_stats.rb

Overview

The Portal2Stats class represents the game statistics for a single user in Portal 2

Instance Attribute Summary collapse

Attributes inherited from GameStats

#app_id, #custom_url, #game_friendly_name, #game_name, #hours_played, #privacy_state, #steam_id64

Instance Method Summary collapse

Methods inherited from GameStats

#achievements, #achievements_done, #achievements_percentage, #base_url, create_game_stats, #public?

Constructor Details

#initialize(steam_id) ⇒ Portal2Stats

Creates a Portal2Stats object by calling the super constructor with the game name “portal2”



17
18
19
# File 'lib/steam/community/portal2/portal2_stats.rb', line 17

def initialize(steam_id)
  super steam_id, 'portal2'
end

Instance Attribute Details

#accumulated_pointsObject (readonly)

Returns the value of attribute accumulated_points.



13
14
15
# File 'lib/steam/community/portal2/portal2_stats.rb', line 13

def accumulated_points
  @accumulated_points
end

Instance Method Details

#inventoryObject

Returns the current Portal 2 inventory (a.k.a Robot Enrichment) of this player



23
24
25
26
# File 'lib/steam/community/portal2/portal2_stats.rb', line 23

def inventory
  @inventory = Portal2Inventory.new(steam_id64) if @inventory.nil?
  @inventory
end