Class: LeagueOfLegends::DTO::RankedStats
- Defined in:
- lib/league_of_legends/dto/ranked_stats.rb
Instance Attribute Summary collapse
-
#champions ⇒ Object
readonly
Returns the value of attribute champions.
-
#modify_date ⇒ Object
readonly
Returns the value of attribute modify_date.
-
#summoner_id ⇒ Object
readonly
Returns the value of attribute summoner_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json) ⇒ RankedStats
constructor
A new instance of RankedStats.
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
#champions ⇒ Object (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_date ⇒ Object (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_id ⇒ Object (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
.version ⇒ Object
8 9 10 |
# File 'lib/league_of_legends/dto/ranked_stats.rb', line 8 def self.version 'v1.2' end |