Class: LeagueOfLegends::DTO::ChampionStats

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ ChampionStats



13
14
15
16
17
18
19
# File 'lib/league_of_legends/dto/champion_stats.rb', line 13

def initialize attributes
  return if attributes.nil?

  @id = attributes[:id].to_i
  @name = attributes[:name]
  @stats = ::LeagueOfLegends::DTO::AggregatedStats.new(attributes[:stats])
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#statsObject (readonly)

Returns the value of attribute stats.



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

def stats
  @stats
end

Class Method Details

.versionObject



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

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