Class: LeagueOfLegends::DTO::RankedStats

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ RankedStats

Returns a new instance of RankedStats.



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

def initialize json
  attributes = build_attributes json

  @summoner_id = attributes[:summonerId].to_i
  @modify_date = Time.at(attributes[:modifyDate]/1000)
  @champions = attributes[:champions].map do |champion|
    ::LeagueOfLegends::DTO::ChampionStats.new(champion)
  end
end

Instance Attribute Details

#championsObject (readonly)

Returns the value of attribute champions.



12
13
14
# File 'lib/league_of_legends/dto/ranked_stats.rb', line 12

def champions
  @champions
end

#modify_dateObject (readonly)

Returns the value of attribute modify_date.



12
13
14
# File 'lib/league_of_legends/dto/ranked_stats.rb', line 12

def modify_date
  @modify_date
end

#summoner_idObject (readonly)

Returns the value of attribute summoner_id.



12
13
14
# File 'lib/league_of_legends/dto/ranked_stats.rb', line 12

def summoner_id
  @summoner_id
end

Class Method Details

.versionObject



8
9
10
# File 'lib/league_of_legends/dto/ranked_stats.rb', line 8

def self.version
  'v1.2'
end