Class: Sightstone::PlayerStatSummary

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

Overview

stat sumary for a queue

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ PlayerStatSummary

Returns a new instance of PlayerStatSummary.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/sightstone/player_stats_summary.rb', line 27

def initialize(data)
  @wins = data['wins']
  @losses = data['losses']
  @modifyDate = data['modifyDate']
  @playerStatSummaryType = data['playerStatSummaryType']  
  @aggregatedStats = {}
  stat_keys = data['aggregatedStats'].keys
  stat_keys.each do |stat|
    @aggregatedStats[stat] = data['aggregatedStats'][stat]
  end
end

Instance Attribute Details

#aggregatedStatsHash<String, Fixnum>

a hash of all stats (key) and their values.

Returns:

  • (Hash<String, Fixnum>)

    the current value of aggregatedStats



24
25
26
# File 'lib/sightstone/player_stats_summary.rb', line 24

def aggregatedStats
  @aggregatedStats
end

#lossesFixnum

number of lost games

Returns:

  • (Fixnum)

    the current value of losses



24
25
26
# File 'lib/sightstone/player_stats_summary.rb', line 24

def losses
  @losses
end

#modifyDateFixnum

date of modification as unix date

Returns:

  • (Fixnum)

    the current value of modifyDate



24
25
26
# File 'lib/sightstone/player_stats_summary.rb', line 24

def modifyDate
  @modifyDate
end

#playerStatSummaryTypeString

type of the stat (can be: AramUnranked5x5, CoopVsAI, OdinUnranked, RankedPremade3x3, RankedPremade5x5, RankedSolo5x5, RankedTeam3x3, RankedTeam5x5, Unranked, Unranked3x3, OneForAll5x5, FirstBlood1x1, FirstBlood2x2)

Returns:

  • (String)

    the current value of playerStatSummaryType



24
25
26
# File 'lib/sightstone/player_stats_summary.rb', line 24

def playerStatSummaryType
  @playerStatSummaryType
end

#winsFixnum

number of won game

Returns:

  • (Fixnum)

    the current value of wins



24
25
26
# File 'lib/sightstone/player_stats_summary.rb', line 24

def wins
  @wins
end