Class: SteamCondenser::Community::GameLeaderboardEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/steam-condenser/community/game_leaderboard_entry.rb

Overview

The GameLeaderboard class represents a single entry in a leaderboard

Author:

  • Sebastian Staudt

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry_data, leaderboard) ⇒ GameLeaderboardEntry

Creates new entry instance for the given XML data and leaderboard


39
40
41
42
43
44
# File 'lib/steam-condenser/community/game_leaderboard_entry.rb', line 39

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

#leaderboardGameLeaderboard (readonly)

Returns the leaderboard this entry belongs to


31
32
33
# File 'lib/steam-condenser/community/game_leaderboard_entry.rb', line 31

def leaderboard
  @leaderboard
end

#rankFixnum (readonly)

Returns the rank where this entry is listed in the leaderboard


26
27
28
# File 'lib/steam-condenser/community/game_leaderboard_entry.rb', line 26

def rank
  @rank
end

#scoreFixnum (readonly)

Returns the score of this entry


21
22
23
# File 'lib/steam-condenser/community/game_leaderboard_entry.rb', line 21

def score
  @score
end

#steam_idSteamId (readonly)

Returns the Steam ID of this entry's player


16
17
18
# File 'lib/steam-condenser/community/game_leaderboard_entry.rb', line 16

def steam_id
  @steam_id
end