Class: RUBG::Participant
- Inherits:
-
Object
- Object
- RUBG::Participant
- Defined in:
- lib/rubg/participant.rb
Instance Attribute Summary collapse
-
#actor ⇒ Object
readonly
Returns the value of attribute actor.
-
#assists ⇒ Object
readonly
Returns the value of attribute assists.
-
#boosts ⇒ Object
readonly
Returns the value of attribute boosts.
-
#damage_dealt ⇒ Object
readonly
Returns the value of attribute damage_dealt.
-
#dbnos ⇒ Object
(also: #downed)
readonly
Returns the value of attribute dbnos.
-
#death_type ⇒ Object
readonly
Returns the value of attribute death_type.
-
#headshot_kills ⇒ Object
readonly
Returns the value of attribute headshot_kills.
-
#heals ⇒ Object
readonly
Returns the value of attribute heals.
-
#kill_place ⇒ Object
readonly
Returns the value of attribute kill_place.
-
#kill_ranking_before ⇒ Object
readonly
Returns the value of attribute kill_ranking_before.
-
#kill_ranking_gained ⇒ Object
readonly
Returns the value of attribute kill_ranking_gained.
-
#kill_streaks ⇒ Object
readonly
Returns the value of attribute kill_streaks.
-
#kills ⇒ Object
readonly
Returns the value of attribute kills.
-
#last_kill_points ⇒ Object
readonly
Returns the value of attribute last_kill_points.
-
#last_win_points ⇒ Object
readonly
Returns the value of attribute last_win_points.
-
#longest_kill ⇒ Object
readonly
Returns the value of attribute longest_kill.
-
#most_damage ⇒ Object
readonly
Returns the value of attribute most_damage.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#overall_ranking_gained ⇒ Object
readonly
Returns the value of attribute overall_ranking_gained.
-
#participant_id ⇒ Object
readonly
Returns the value of attribute participant_id.
-
#player_id ⇒ Object
readonly
Returns the value of attribute player_id.
-
#revives ⇒ Object
readonly
Returns the value of attribute revives.
-
#ride_distance ⇒ Object
readonly
Returns the value of attribute ride_distance.
-
#road_kills ⇒ Object
readonly
Returns the value of attribute road_kills.
-
#shard ⇒ Object
readonly
Returns the value of attribute shard.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
-
#team_kills ⇒ Object
readonly
Returns the value of attribute team_kills.
-
#time_survived ⇒ Object
readonly
Returns the value of attribute time_survived.
-
#vehicle_destroys ⇒ Object
readonly
Returns the value of attribute vehicle_destroys.
-
#walk_distance ⇒ Object
readonly
Returns the value of attribute walk_distance.
-
#weapons_acquired ⇒ Object
readonly
Returns the value of attribute weapons_acquired.
-
#win_place ⇒ Object
readonly
Returns the value of attribute win_place.
-
#win_ranking_before ⇒ Object
readonly
Returns the value of attribute win_ranking_before.
-
#win_ranking_gained ⇒ Object
readonly
Returns the value of attribute win_ranking_gained.
Instance Method Summary collapse
-
#initialize(args) ⇒ Participant
constructor
A new instance of Participant.
Constructor Details
#initialize(args) ⇒ Participant
Returns a new instance of Participant.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rubg/participant.rb', line 12 def initialize( args ) if args[:participant_hash] @participant_id = args[:participant_hash]["id"] @actor = args[:participant_hash]["attributes"]["actor"] @shard = args[:participant_hash]["attributes"]["shardId"] @dbnos = args[:participant_hash]["attributes"]["stats"]["DBNOs"] @assists = args[:participant_hash]["attributes"]["stats"]["assists"] @boosts = args[:participant_hash]["attributes"]["stats"]["boosts"] @damage_dealt = args[:participant_hash]["attributes"]["stats"]["damageDealt"] @death_type = args[:participant_hash]["attributes"]["stats"]["deathType"] @headshot_kills = args[:participant_hash]["attributes"]["stats"]["headshotKills"] @heals = args[:participant_hash]["attributes"]["stats"]["heals"] @kill_place = args[:participant_hash]["attributes"]["stats"]["killPlace"] @kill_ranking_before = args[:participant_hash]["attributes"]["stats"]["killPoints"] @kill_ranking_gained = args[:participant_hash]["attributes"]["stats"]["killPointsDelta"].to_i @kill_streaks = args[:participant_hash]["attributes"]["stats"]["killStreaks"] @kills = args[:participant_hash]["attributes"]["stats"]["kills"] @last_kill_points = args[:participant_hash]["attributes"]["stats"]["lastKillPoints"] @last_win_points = args[:participant_hash]["attributes"]["stats"]["lastWinPoints"] @longest_kill = args[:participant_hash]["attributes"]["stats"]["longestKill"] @most_damage = args[:participant_hash]["attributes"]["stats"]["mostDamage"] @name = args[:participant_hash]["attributes"]["stats"]["name"] @player_id = args[:participant_hash]["attributes"]["stats"]["playerId"] @revives = args[:participant_hash]["attributes"]["stats"]["revives"] @ride_distance = args[:participant_hash]["attributes"]["stats"]["rideDistance"] @road_kills = args[:participant_hash]["attributes"]["stats"]["roadKills"] @team_kills = args[:participant_hash]["attributes"]["stats"]["teamKills"] @time_survived = args[:participant_hash]["attributes"]["stats"]["timeSurvived"] @vehicle_destroys = args[:participant_hash]["attributes"]["stats"]["vehicleDestroys"] @walk_distance = args[:participant_hash]["attributes"]["stats"]["walkDistance"] @weapons_acquired = args[:participant_hash]["attributes"]["stats"]["weaponsAcquired"] @win_place = args[:participant_hash]["attributes"]["stats"]["winPlace"] @win_ranking_before = args[:participant_hash]["attributes"]["stats"]["winPoints"] @win_ranking_gained = args[:participant_hash]["attributes"]["stats"]["winPointsDelta"].to_i @overall_ranking_gained = ( args[:participant_hash]["attributes"]["stats"]["winPointsDelta"] + ( args[:participant_hash]["attributes"]["stats"]["killPointsDelta"] * 0.2) ).to_i @stats = args[:participant_hash]["attributes"]["stats"] end end |
Instance Attribute Details
#actor ⇒ Object (readonly)
Returns the value of attribute actor.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def actor @actor end |
#assists ⇒ Object (readonly)
Returns the value of attribute assists.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def assists @assists end |
#boosts ⇒ Object (readonly)
Returns the value of attribute boosts.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def boosts @boosts end |
#damage_dealt ⇒ Object (readonly)
Returns the value of attribute damage_dealt.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def damage_dealt @damage_dealt end |
#dbnos ⇒ Object (readonly) Also known as: downed
Returns the value of attribute dbnos.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def dbnos @dbnos end |
#death_type ⇒ Object (readonly)
Returns the value of attribute death_type.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def death_type @death_type end |
#headshot_kills ⇒ Object (readonly)
Returns the value of attribute headshot_kills.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def headshot_kills @headshot_kills end |
#heals ⇒ Object (readonly)
Returns the value of attribute heals.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def heals @heals end |
#kill_place ⇒ Object (readonly)
Returns the value of attribute kill_place.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def kill_place @kill_place end |
#kill_ranking_before ⇒ Object (readonly)
Returns the value of attribute kill_ranking_before.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def kill_ranking_before @kill_ranking_before end |
#kill_ranking_gained ⇒ Object (readonly)
Returns the value of attribute kill_ranking_gained.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def kill_ranking_gained @kill_ranking_gained end |
#kill_streaks ⇒ Object (readonly)
Returns the value of attribute kill_streaks.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def kill_streaks @kill_streaks end |
#kills ⇒ Object (readonly)
Returns the value of attribute kills.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def kills @kills end |
#last_kill_points ⇒ Object (readonly)
Returns the value of attribute last_kill_points.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def last_kill_points @last_kill_points end |
#last_win_points ⇒ Object (readonly)
Returns the value of attribute last_win_points.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def last_win_points @last_win_points end |
#longest_kill ⇒ Object (readonly)
Returns the value of attribute longest_kill.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def longest_kill @longest_kill end |
#most_damage ⇒ Object (readonly)
Returns the value of attribute most_damage.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def most_damage @most_damage end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def name @name end |
#overall_ranking_gained ⇒ Object (readonly)
Returns the value of attribute overall_ranking_gained.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def overall_ranking_gained @overall_ranking_gained end |
#participant_id ⇒ Object (readonly)
Returns the value of attribute participant_id.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def participant_id @participant_id end |
#player_id ⇒ Object (readonly)
Returns the value of attribute player_id.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def player_id @player_id end |
#revives ⇒ Object (readonly)
Returns the value of attribute revives.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def revives @revives end |
#ride_distance ⇒ Object (readonly)
Returns the value of attribute ride_distance.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def ride_distance @ride_distance end |
#road_kills ⇒ Object (readonly)
Returns the value of attribute road_kills.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def road_kills @road_kills end |
#shard ⇒ Object (readonly)
Returns the value of attribute shard.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def shard @shard end |
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def stats @stats end |
#team_kills ⇒ Object (readonly)
Returns the value of attribute team_kills.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def team_kills @team_kills end |
#time_survived ⇒ Object (readonly)
Returns the value of attribute time_survived.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def time_survived @time_survived end |
#vehicle_destroys ⇒ Object (readonly)
Returns the value of attribute vehicle_destroys.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def vehicle_destroys @vehicle_destroys end |
#walk_distance ⇒ Object (readonly)
Returns the value of attribute walk_distance.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def walk_distance @walk_distance end |
#weapons_acquired ⇒ Object (readonly)
Returns the value of attribute weapons_acquired.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def weapons_acquired @weapons_acquired end |
#win_place ⇒ Object (readonly)
Returns the value of attribute win_place.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def win_place @win_place end |
#win_ranking_before ⇒ Object (readonly)
Returns the value of attribute win_ranking_before.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def win_ranking_before @win_ranking_before end |
#win_ranking_gained ⇒ Object (readonly)
Returns the value of attribute win_ranking_gained.
3 4 5 |
# File 'lib/rubg/participant.rb', line 3 def win_ranking_gained @win_ranking_gained end |