Class: GameLeaderboardEntry
- Inherits:
-
Object
- Object
- GameLeaderboardEntry
- Defined in:
- lib/steam/community/game_leaderboard_entry.rb
Overview
The GameLeaderboard class represents a single entry in a leaderboard
Instance Attribute Summary collapse
-
#leaderboard ⇒ GameLeaderboard
readonly
Returns the leaderboard this entry belongs to.
-
#rank ⇒ Fixnum
readonly
Returns the rank where this entry is listed in the leaderboard.
-
#score ⇒ Fixnum
readonly
Returns the score of this entry.
-
#steam_id ⇒ SteamId
readonly
Returns the Steam ID of this entry’s player.
Instance Method Summary collapse
-
#initialize(entry_data, leaderboard) ⇒ GameLeaderboardEntry
constructor
Creates new entry instance for the given XML data and leaderboard.
Constructor Details
#initialize(entry_data, leaderboard) ⇒ GameLeaderboardEntry
Creates new entry instance for the given XML data and leaderboard
36 37 38 39 40 41 |
# File 'lib/steam/community/game_leaderboard_entry.rb', line 36 def initialize(entry_data, leaderboard) @steam_id = SteamId.new entry_data['steamid'].to_i, false @score = entry_data['score'].to_i @rank = entry_data['rank'].to_i @leaderboard = leaderboard end |
Instance Attribute Details
#leaderboard ⇒ GameLeaderboard (readonly)
Returns the leaderboard this entry belongs to
29 30 31 |
# File 'lib/steam/community/game_leaderboard_entry.rb', line 29 def leaderboard @leaderboard end |
#rank ⇒ Fixnum (readonly)
Returns the rank where this entry is listed in the leaderboard
24 25 26 |
# File 'lib/steam/community/game_leaderboard_entry.rb', line 24 def rank @rank end |
#score ⇒ Fixnum (readonly)
Returns the score of this entry
19 20 21 |
# File 'lib/steam/community/game_leaderboard_entry.rb', line 19 def score @score end |
#steam_id ⇒ SteamId (readonly)
Returns the Steam ID of this entry’s player
14 15 16 |
# File 'lib/steam/community/game_leaderboard_entry.rb', line 14 def steam_id @steam_id end |