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

Methods included from Utilities::Inspectable

#inspect

Methods inherited from Entity

#initialize

Constructor Details

This class inherits a constructor from Dota::API::Entity

Instance Method Details

#clusterObject



60
61
62
# File 'lib/dota/api/match.rb', line 60

def cluster
  raw["cluster"]
end

#direObject



74
75
76
# File 'lib/dota/api/match.rb', line 74

def dire
  @dire ||= Side.new(raw_side(:dire))
end

#draftsObject



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

#durationObject



4
5
6
# File 'lib/dota/api/match.rb', line 4

def duration
  raw["duration"]
end

#first_bloodObject



36
37
38
# File 'lib/dota/api/match.rb', line 36

def first_blood
  raw["first_blood_time"]
end

#league_idObject



8
9
10
# File 'lib/dota/api/match.rb', line 8

def league_id
  raw["leagueid"]
end

#modeObject



12
13
14
# File 'lib/dota/api/match.rb', line 12

def mode
  MODES[raw["game_mode"]]
end

#mode_idObject



16
17
18
# File 'lib/dota/api/match.rb', line 16

def mode_id
  raw["game_mode"]
end

#negative_votesObject



48
49
50
# File 'lib/dota/api/match.rb', line 48

def negative_votes
  raw["negative_votes"]
end

#players_countObject



56
57
58
# File 'lib/dota/api/match.rb', line 56

def players_count
  raw["human_players"]
end

#positive_votesObject



44
45
46
# File 'lib/dota/api/match.rb', line 44

def positive_votes
  raw["positive_votes"]
end

#radiantObject



70
71
72
# File 'lib/dota/api/match.rb', line 70

def radiant
  @radiant ||= Side.new(raw_side(:radiant))
end

#seasonObject



52
53
54
# File 'lib/dota/api/match.rb', line 52

def season
  raw["season"]
end

#sequenceObject



28
29
30
# File 'lib/dota/api/match.rb', line 28

def sequence
  raw["match_seq_num"]
end

#starts_atObject



32
33
34
# File 'lib/dota/api/match.rb', line 32

def starts_at
  Time.at(raw["start_time"])
end

#typeObject



20
21
22
# File 'lib/dota/api/match.rb', line 20

def type
  TYPES[raw["lobby_type"]]
end

#type_idObject



24
25
26
# File 'lib/dota/api/match.rb', line 24

def type_id
  raw["lobby_type"]
end

#winnerObject



40
41
42
# File 'lib/dota/api/match.rb', line 40

def winner
  raw["radiant_win"] ? :radiant : :dire
end