Class: Sightstone::HistoryGame

Inherits:
Object
  • Object
show all
Defined in:
lib/sightstone/match_history.rb

Overview

A played game

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#championIdFixnum

ID of the played champ of requested summoner

Returns:

  • (Fixnum)

    the current value of championId



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def championId
  @championId
end

#createDateFixnum

UNIX timestamp of creation date of the games

Returns:

  • (Fixnum)

    the current value of createDate



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def createDate
  @createDate
end

#fellowPlayersArray<Player>

a list of all players of the game

Returns:

  • (Array<Player>)

    the current value of fellowPlayers



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def fellowPlayers
  @fellowPlayers
end

#gameIdFixnum

ID of the game

Returns:

  • (Fixnum)

    the current value of gameId



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def gameId
  @gameId
end

#gameModeString

mode of the game

Returns:

  • (String)

    the current value of gameMode



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def gameMode
  @gameMode
end

#gameTypeString

type of the game

Returns:

  • (String)

    the current value of gameType



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def gameType
  @gameType
end

#invalidBoolean

Invalid flag #TODO what is this?

Returns:

  • (Boolean)

    the current value of invalid



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def invalid
  @invalid
end

#levelFixnum

level of the requested summoner

Returns:

  • (Fixnum)

    the current value of level



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def level
  @level
end

#mapIdFixnum

ID of the played map

Returns:

  • (Fixnum)

    the current value of mapId



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def mapId
  @mapId
end

#spell1Fixnum

selected summoner spell no 1

Returns:

  • (Fixnum)

    the current value of spell1



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def spell1
  @spell1
end

#spell2Fixnum

selected summoner spell no 2

Returns:

  • (Fixnum)

    the current value of spell2



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def spell2
  @spell2
end

#statisticsHash<String, Fixnum, Boolean>

statistics of the game as a Hash: name -> value

Returns:

  • (Hash<String, Fixnum, Boolean>)

    the current value of statistics



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def statistics
  @statistics
end

#subtypeString

subtype

Returns:

  • (String)

    the current value of subtype



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def subtype
  @subtype
end

#subTypeObject

Returns the value of attribute subType.



33
34
35
# File 'lib/sightstone/match_history.rb', line 33

def subType
  @subType
end

#teamIdFixnum

ID of the team if there is a team associated to the game

Returns:

  • (Fixnum)

    the current value of teamId



32
33
34
# File 'lib/sightstone/match_history.rb', line 32

def teamId
  @teamId
end