Class: LolApi::Match
Instance Attribute Summary
Attributes inherited from HistoryMatch
#raw_match
Instance Method Summary
collapse
#initialize, #map_id, #match_creation, #match_duration, #match_id, #match_version, #participant_identities, #participants, #queue_type, #region, #season
Instance Method Details
#blue_team ⇒ Object
25
26
27
|
# File 'lib/lol_api/types/match.rb', line 25
def blue_team
[ teams[0], participants.select { |x| x.team_id == 100 } ]
end
|
#match_mode ⇒ Object
11
12
13
|
# File 'lib/lol_api/types/match.rb', line 11
def match_mode
raw_match['matchMode']
end
|
#match_type ⇒ Object
7
8
9
|
# File 'lib/lol_api/types/match.rb', line 7
def match_type
raw_match['matchType']
end
|
#purple_team ⇒ Object
29
30
31
|
# File 'lib/lol_api/types/match.rb', line 29
def purple_team
[ teams[1], participants.select { |x| x.team_id == 200 } ]
end
|
#teams ⇒ Object
15
16
17
18
19
|
# File 'lib/lol_api/types/match.rb', line 15
def teams
if teams = raw_match['teams']
teams.map { |e| Team.new(e) }
end
end
|
#timeline ⇒ Object
21
22
23
|
# File 'lib/lol_api/types/match.rb', line 21
def timeline
Timeline.new(raw_match['timeline'])
end
|
#ward_placements ⇒ Object
33
34
35
36
37
38
39
|
# File 'lib/lol_api/types/match.rb', line 33
def ward_placements
timeline.frames.map do |f|
f.events.select do |e|
e.event_type == "WARD_PLACED"
end
end.flatten
end
|