Class: RiotKit::Models::Riot::Player::Stats

Inherits:
Object
  • Object
show all
Defined in:
lib/riot_kit/models/riot/player/stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attrs) ⇒ Stats

Returns a new instance of Stats.



12
13
14
15
16
17
18
19
20
# File 'lib/riot_kit/models/riot/player/stats.rb', line 12

def initialize(**attrs)
  @kills = attrs[:kills]
  @deaths = attrs[:deaths]
  @assists = attrs[:assists]
  @kda = attrs[:kda]
  @kill_participation = attrs[:kill_participation]
  @total_time_spent_dead = attrs[:total_time_spent_dead]
  @longest_time_spent_living = attrs[:longest_time_spent_living]
end

Instance Attribute Details

#assistsObject (readonly)

Returns the value of attribute assists.



8
9
10
# File 'lib/riot_kit/models/riot/player/stats.rb', line 8

def assists
  @assists
end

#deathsObject (readonly)

Returns the value of attribute deaths.



8
9
10
# File 'lib/riot_kit/models/riot/player/stats.rb', line 8

def deaths
  @deaths
end

#kdaObject (readonly)

Returns the value of attribute kda.



8
9
10
# File 'lib/riot_kit/models/riot/player/stats.rb', line 8

def kda
  @kda
end

#kill_participationObject (readonly)

Returns the value of attribute kill_participation.



8
9
10
# File 'lib/riot_kit/models/riot/player/stats.rb', line 8

def kill_participation
  @kill_participation
end

#killsObject (readonly)

Returns the value of attribute kills.



8
9
10
# File 'lib/riot_kit/models/riot/player/stats.rb', line 8

def kills
  @kills
end

#longest_time_spent_livingObject (readonly)

Returns the value of attribute longest_time_spent_living.



8
9
10
# File 'lib/riot_kit/models/riot/player/stats.rb', line 8

def longest_time_spent_living
  @longest_time_spent_living
end

#total_time_spent_deadObject (readonly)

Returns the value of attribute total_time_spent_dead.



8
9
10
# File 'lib/riot_kit/models/riot/player/stats.rb', line 8

def total_time_spent_dead
  @total_time_spent_dead
end

Instance Method Details

#to_hObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/riot_kit/models/riot/player/stats.rb', line 22

def to_h
  {
    kills: kills,
    deaths: deaths,
    assists: assists,
    kda: kda,
    kill_participation: kill_participation,
    total_time_spent_dead: total_time_spent_dead,
    longest_time_spent_living: longest_time_spent_living
  }
end