Class: RiotKit::Models::Riot::Player::Stats
- Inherits:
-
Object
- Object
- RiotKit::Models::Riot::Player::Stats
- Defined in:
- lib/riot_kit/models/riot/player/stats.rb
Instance Attribute Summary collapse
-
#assists ⇒ Object
readonly
Returns the value of attribute assists.
-
#deaths ⇒ Object
readonly
Returns the value of attribute deaths.
-
#kda ⇒ Object
readonly
Returns the value of attribute kda.
-
#kill_participation ⇒ Object
readonly
Returns the value of attribute kill_participation.
-
#kills ⇒ Object
readonly
Returns the value of attribute kills.
-
#longest_time_spent_living ⇒ Object
readonly
Returns the value of attribute longest_time_spent_living.
-
#total_time_spent_dead ⇒ Object
readonly
Returns the value of attribute total_time_spent_dead.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ Stats
constructor
A new instance of Stats.
- #to_h ⇒ Object
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
#assists ⇒ Object (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 |
#deaths ⇒ Object (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 |
#kda ⇒ Object (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_participation ⇒ Object (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 |
#kills ⇒ Object (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_living ⇒ Object (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_dead ⇒ Object (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_h ⇒ Object
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 |