Class: Sightstone::HistoryGame
- Inherits:
-
Object
- Object
- Sightstone::HistoryGame
- Defined in:
- lib/sightstone/match_history.rb
Overview
A played game
Instance Attribute Summary collapse
-
#championId ⇒ Fixnum
ID of the played champ of requested summoner.
-
#createDate ⇒ Fixnum
UNIX timestamp of creation date of the games.
-
#fellowPlayers ⇒ Array<Player>
a list of all players of the game.
-
#gameId ⇒ Fixnum
ID of the game.
-
#gameMode ⇒ String
mode of the game.
-
#gameType ⇒ String
type of the game.
-
#invalid ⇒ Boolean
Invalid flag #TODO what is this?.
-
#level ⇒ Fixnum
level of the requested summoner.
-
#mapId ⇒ Fixnum
ID of the played map.
-
#spell1 ⇒ Fixnum
selected summoner spell no 1.
-
#spell2 ⇒ Fixnum
selected summoner spell no 2.
-
#statistics ⇒ Hash<String, Fixnum, Boolean>
statistics of the game as a Hash: name -> value.
-
#subtype ⇒ String
subtype.
-
#subType ⇒ Object
Returns the value of attribute subType.
-
#teamId ⇒ Fixnum
ID of the team if there is a team associated to the game.
Instance Method Summary collapse
-
#initialize(data) ⇒ HistoryGame
constructor
A new instance of HistoryGame.
Constructor Details
#initialize(data) ⇒ HistoryGame
Returns a new instance of HistoryGame.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/sightstone/match_history.rb', line 35 def initialize(data) @championId=data['championId'] @createDate=data['createDate'] @createDateString=data['createDateString'] @fellowPlayers=[] if(data.has_key? "fellowPlayers") data['fellowPlayers'].each do |player| @fellowPlayers << Player.new(player) end end @gameId=data['gameId'] @gameMode=data['gameMode'] @gameType=data['gameType'] @invalid=data['invalid'] @level=data['level'] @mapId=data['mapId'] @spell1=data['spell1'] @spell2=data['spell2'] @statistics = {} data['stats'].each do |key, stat| @statistics[key] = stat end @subType=data['subType'] @teamId=data['teamId'] end |
Instance Attribute Details
#championId ⇒ Fixnum
ID of the played champ of requested summoner
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def championId @championId end |
#createDate ⇒ Fixnum
UNIX timestamp of creation date of the games
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def createDate @createDate end |
#fellowPlayers ⇒ Array<Player>
a list of all players of the game
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def fellowPlayers @fellowPlayers end |
#gameId ⇒ Fixnum
ID of the game
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def gameId @gameId end |
#gameMode ⇒ String
mode of the game
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def gameMode @gameMode end |
#gameType ⇒ String
type of the game
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def gameType @gameType end |
#invalid ⇒ Boolean
Invalid flag #TODO what is this?
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def invalid @invalid end |
#level ⇒ Fixnum
level of the requested summoner
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def level @level end |
#mapId ⇒ Fixnum
ID of the played map
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def mapId @mapId end |
#spell1 ⇒ Fixnum
selected summoner spell no 1
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def spell1 @spell1 end |
#spell2 ⇒ Fixnum
selected summoner spell no 2
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def spell2 @spell2 end |
#statistics ⇒ Hash<String, Fixnum, Boolean>
statistics of the game as a Hash: name -> value
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def statistics @statistics end |
#subtype ⇒ String
subtype
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def subtype @subtype end |
#subType ⇒ Object
Returns the value of attribute subType.
33 34 35 |
# File 'lib/sightstone/match_history.rb', line 33 def subType @subType end |
#teamId ⇒ Fixnum
ID of the team if there is a team associated to the game
32 33 34 |
# File 'lib/sightstone/match_history.rb', line 32 def teamId @teamId end |