Class: Dota::API::Match::Player
Constant Summary
collapse
- SLOT_GAP =
128
Constants inherited
from BasicPlayer
BasicPlayer::STATUS, BasicPlayer::TYPES
Instance Attribute Summary
Attributes inherited from Entity
#raw
Instance Method Summary
collapse
Methods inherited from BasicPlayer
#assists, #denies, #gold, #gpm, #hero, #id, #kills, #last_hits, #level, #xpm
#inspect
Methods inherited from Entity
#initialize
Instance Method Details
#ability_upgrades ⇒ Object
44
45
46
47
48
|
# File 'lib/dota/api/match/player.rb', line 44
def ability_upgrades
raw["ability_upgrades"] ?
raw["ability_upgrades"].map { |ability_upgrade| AbilityUpgrade.new(ability_upgrade) } :
[]
end
|
#additional_units ⇒ Object
38
39
40
41
42
|
# File 'lib/dota/api/match/player.rb', line 38
def additional_units
raw["additional_units"] ?
raw["additional_units"].map { |unit| Unit.new(unit["unitname"], (unit)) } :
[]
end
|
#deaths ⇒ Object
18
19
20
|
# File 'lib/dota/api/match/player.rb', line 18
def deaths
raw["deaths"]
end
|
#gold_spent ⇒ Object
22
23
24
|
# File 'lib/dota/api/match/player.rb', line 22
def gold_spent
raw["gold_spent"]
end
|
#hero_damage ⇒ Object
26
27
28
|
# File 'lib/dota/api/match/player.rb', line 26
def hero_damage
raw["hero_damage"]
end
|
#hero_healing ⇒ Object
34
35
36
|
# File 'lib/dota/api/match/player.rb', line 34
def hero_healing
raw["hero_healing"]
end
|
#items ⇒ Object
50
51
52
|
# File 'lib/dota/api/match/player.rb', line 50
def items
raw
end
|
#slot ⇒ Object
8
9
10
11
12
|
# File 'lib/dota/api/match/player.rb', line 8
def slot
slot = raw["player_slot"]
slot -= SLOT_GAP if slot >= SLOT_GAP
slot + 1
end
|
#status ⇒ Object
14
15
16
|
# File 'lib/dota/api/match/player.rb', line 14
def status
STATUS[raw["leaver_status"]]
end
|
#tower_damage ⇒ Object
30
31
32
|
# File 'lib/dota/api/match/player.rb', line 30
def tower_damage
raw["tower_damage"]
end
|