Class: OpenDotaApi::Match
Defined Under Namespace
Classes: Player
Constant Summary
collapse
- ENDPOINT =
'matches'.freeze
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Entity
define_adder, #initialize
included
Class Method Details
.instantiate(_ = nil) ⇒ Object
8
9
10
|
# File 'lib/open_dota_api/match.rb', line 8
def self.instantiate(_ = nil)
raise NotImplementedError
end
|
Instance Method Details
#cluster ⇒ Object
56
57
58
|
# File 'lib/open_dota_api/match.rb', line 56
def cluster
data['cluster']
end
|
#dire_score ⇒ Object
76
77
78
|
# File 'lib/open_dota_api/match.rb', line 76
def dire_score
data['dire_score']
end
|
#dire_team_id ⇒ Object
36
37
38
|
# File 'lib/open_dota_api/match.rb', line 36
def dire_team_id
data.dig('dire_team', 'team_id')
end
|
#duration ⇒ Object
20
21
22
|
# File 'lib/open_dota_api/match.rb', line 20
def duration
data['duration']
end
|
#first_blood_time ⇒ Object
48
49
50
|
# File 'lib/open_dota_api/match.rb', line 48
def first_blood_time
data['first_blood_time']
end
|
#league_id ⇒ Object
44
45
46
|
# File 'lib/open_dota_api/match.rb', line 44
def league_id
data['leagueid']
end
|
#match_id ⇒ Object
12
13
14
|
# File 'lib/open_dota_api/match.rb', line 12
def match_id
data['match_id']
end
|
#match_seq_num ⇒ Object
40
41
42
|
# File 'lib/open_dota_api/match.rb', line 40
def match_seq_num
data['match_seq_num']
end
|
#players ⇒ Object
68
69
70
|
# File 'lib/open_dota_api/match.rb', line 68
def players
Player.instantiate(data['players'])
end
|
#radiant_score ⇒ Object
72
73
74
|
# File 'lib/open_dota_api/match.rb', line 72
def radiant_score
data['radiant_score']
end
|
#radiant_team_id ⇒ Object
32
33
34
|
# File 'lib/open_dota_api/match.rb', line 32
def radiant_team_id
data.dig('radiant_team', 'team_id')
end
|
#replay_salt ⇒ Object
60
61
62
|
# File 'lib/open_dota_api/match.rb', line 60
def replay_salt
data['replay_salt']
end
|
#replay_url ⇒ Object
64
65
66
|
# File 'lib/open_dota_api/match.rb', line 64
def replay_url
"http://replay#{cluster}.valve.net/570/#{match_id}_#{replay_salt}.dem.bz2"
end
|
#series_id ⇒ Object
24
25
26
|
# File 'lib/open_dota_api/match.rb', line 24
def series_id
data['series_id']
end
|
#series_type ⇒ Object
28
29
30
|
# File 'lib/open_dota_api/match.rb', line 28
def series_type
data['series_type']
end
|
#start_time ⇒ Object
16
17
18
|
# File 'lib/open_dota_api/match.rb', line 16
def start_time
data['start_time']
end
|
#winner ⇒ Object
52
53
54
|
# File 'lib/open_dota_api/match.rb', line 52
def winner
data['radiant_win'] ? :radiant : :dire
end
|