Class: Dota::API::Match
- Inherits:
-
BasicMatch
show all
- Defined in:
- lib/dota/api/match.rb,
lib/dota/api/match/side.rb,
lib/dota/api/match/unit.rb,
lib/dota/api/match/draft.rb,
lib/dota/api/match/player.rb,
lib/dota/api/match/ability_upgrade.rb
Defined Under Namespace
Classes: AbilityUpgrade, Draft, Player, Side, Unit
Constant Summary
Constants inherited
from BasicMatch
BasicMatch::MODES, BasicMatch::SKILL_LEVELS, BasicMatch::TYPES
Instance Attribute Summary
Attributes inherited from Entity
#raw
Instance Method Summary
collapse
Methods inherited from BasicMatch
#id
#inspect
Methods inherited from Entity
#initialize
Instance Method Details
#cluster ⇒ Object
60
61
62
|
# File 'lib/dota/api/match.rb', line 60
def cluster
raw["cluster"]
end
|
#dire ⇒ Object
74
75
76
|
# File 'lib/dota/api/match.rb', line 74
def dire
@dire ||= Side.new(raw_side(:dire))
end
|
#drafts ⇒ Object
64
65
66
67
68
|
# File 'lib/dota/api/match.rb', line 64
def drafts
@drafts ||= (raw["picks_bans"] || []).map do |raw_draft|
Draft.new(raw_draft)
end
end
|
#duration ⇒ Object
4
5
6
|
# File 'lib/dota/api/match.rb', line 4
def duration
raw["duration"]
end
|
#first_blood ⇒ Object
36
37
38
|
# File 'lib/dota/api/match.rb', line 36
def first_blood
raw["first_blood_time"]
end
|
#league_id ⇒ Object
8
9
10
|
# File 'lib/dota/api/match.rb', line 8
def league_id
raw["leagueid"]
end
|
#mode ⇒ Object
12
13
14
|
# File 'lib/dota/api/match.rb', line 12
def mode
MODES[raw["game_mode"]]
end
|
#mode_id ⇒ Object
16
17
18
|
# File 'lib/dota/api/match.rb', line 16
def mode_id
raw["game_mode"]
end
|
#negative_votes ⇒ Object
48
49
50
|
# File 'lib/dota/api/match.rb', line 48
def negative_votes
raw["negative_votes"]
end
|
#players_count ⇒ Object
56
57
58
|
# File 'lib/dota/api/match.rb', line 56
def players_count
raw["human_players"]
end
|
#positive_votes ⇒ Object
44
45
46
|
# File 'lib/dota/api/match.rb', line 44
def positive_votes
raw["positive_votes"]
end
|
#radiant ⇒ Object
70
71
72
|
# File 'lib/dota/api/match.rb', line 70
def radiant
@radiant ||= Side.new(raw_side(:radiant))
end
|
#season ⇒ Object
52
53
54
|
# File 'lib/dota/api/match.rb', line 52
def season
raw["season"]
end
|
#sequence ⇒ Object
28
29
30
|
# File 'lib/dota/api/match.rb', line 28
def sequence
raw["match_seq_num"]
end
|
#starts_at ⇒ Object
32
33
34
|
# File 'lib/dota/api/match.rb', line 32
def starts_at
Time.at(raw["start_time"])
end
|
#type ⇒ Object
20
21
22
|
# File 'lib/dota/api/match.rb', line 20
def type
TYPES[raw["lobby_type"]]
end
|
#type_id ⇒ Object
24
25
26
|
# File 'lib/dota/api/match.rb', line 24
def type_id
raw["lobby_type"]
end
|
#winner ⇒ Object
40
41
42
|
# File 'lib/dota/api/match.rb', line 40
def winner
raw["radiant_win"] ? :radiant : :dire
end
|