Class: LeagueOfLegends::DTO::PlayerStatsSummary

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ PlayerStatsSummary

Returns a new instance of PlayerStatsSummary.



14
15
16
17
18
19
20
21
22
# File 'lib/league_of_legends/dto/player_stats_summary.rb', line 14

def initialize attributes
  return if attributes.nil?

  @player_stat_summary_type = attributes[:playerStatSummaryType]
  @wins = attributes[:wins].to_i
  @losses = attributes[:losses].to_i
  @modify_date = Time.at(attributes[:modifyDate]/1000)
  @aggregated_stats = ::LeagueOfLegends::DTO::AggregatedStats.new(attributes[:aggregatedStats])
end

Instance Attribute Details

#aggregated_statsObject (readonly)

Returns the value of attribute aggregated_stats.



11
12
13
# File 'lib/league_of_legends/dto/player_stats_summary.rb', line 11

def aggregated_stats
  @aggregated_stats
end

#lossesObject (readonly)

Returns the value of attribute losses.



11
12
13
# File 'lib/league_of_legends/dto/player_stats_summary.rb', line 11

def losses
  @losses
end

#modify_dateObject (readonly)

Returns the value of attribute modify_date.



11
12
13
# File 'lib/league_of_legends/dto/player_stats_summary.rb', line 11

def modify_date
  @modify_date
end

#player_stat_summary_typeObject (readonly)

Returns the value of attribute player_stat_summary_type.



11
12
13
# File 'lib/league_of_legends/dto/player_stats_summary.rb', line 11

def player_stat_summary_type
  @player_stat_summary_type
end

#winsObject (readonly)

Returns the value of attribute wins.



11
12
13
# File 'lib/league_of_legends/dto/player_stats_summary.rb', line 11

def wins
  @wins
end

Class Method Details

.versionObject



7
8
9
# File 'lib/league_of_legends/dto/player_stats_summary.rb', line 7

def self.version
  ::LeagueOfLegends::DTO::PlayerStatsSummaryList.version
end