Class: Rito::Match

Inherits:
ApiBase show all
Defined in:
lib/rito/match.rb

Defined Under Namespace

Classes: BannedChampion, Event, Frame, Mastery, Participant, ParticipantFrame, ParticipantIdentity, ParticipantStats, ParticipantTimeline, ParticipantTimelineData, Player, Position, Rune, Team, Timeline

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiBase

#attributes=, call_api, from_list, from_map, from_map_of_lists

Constructor Details

#initialize(attributes = {}) ⇒ Match

Returns a new instance of Match


19
20
21
22
23
24
25
# File 'lib/rito/match.rb', line 19

def initialize(attributes = {})
	self.participantIdentities = Rito::Match::ParticipantIdentity.from_list(attributes.delete('participantIdentities')) if attributes['participantIdentities']
	self.participants = Rito::Match::Participant.from_list(attributes.delete('participants')) if attributes['participants']
	self.teams = Rito::Match::Team.from_list(attributes.delete('teams')) if attributes['teams']
	self.timeline = Rito::Match::Timeline.new(attributes.delete('timeline')) if attributes['timeline']
	super
end

Instance Attribute Details

#mapIdObject

Returns the value of attribute mapId


3
4
5
# File 'lib/rito/match.rb', line 3

def mapId
  @mapId
end

#matchCreationObject

Returns the value of attribute matchCreation


3
4
5
# File 'lib/rito/match.rb', line 3

def matchCreation
  @matchCreation
end

#matchDurationObject

Returns the value of attribute matchDuration


3
4
5
# File 'lib/rito/match.rb', line 3

def matchDuration
  @matchDuration
end

#matchIdObject

Returns the value of attribute matchId


3
4
5
# File 'lib/rito/match.rb', line 3

def matchId
  @matchId
end

#matchModeObject

Returns the value of attribute matchMode


3
4
5
# File 'lib/rito/match.rb', line 3

def matchMode
  @matchMode
end

#matchTypeObject

Returns the value of attribute matchType


3
4
5
# File 'lib/rito/match.rb', line 3

def matchType
  @matchType
end

#matchVersionObject

Returns the value of attribute matchVersion


3
4
5
# File 'lib/rito/match.rb', line 3

def matchVersion
  @matchVersion
end

#participantIdentitiesObject

Returns the value of attribute participantIdentities


3
4
5
# File 'lib/rito/match.rb', line 3

def participantIdentities
  @participantIdentities
end

#participantsObject

Returns the value of attribute participants


3
4
5
# File 'lib/rito/match.rb', line 3

def participants
  @participants
end

#platformIdObject

Returns the value of attribute platformId


3
4
5
# File 'lib/rito/match.rb', line 3

def platformId
  @platformId
end

#queueTypeObject

Returns the value of attribute queueType


3
4
5
# File 'lib/rito/match.rb', line 3

def queueType
  @queueType
end

#regionObject

Returns the value of attribute region


3
4
5
# File 'lib/rito/match.rb', line 3

def region
  @region
end

#seasonObject

Returns the value of attribute season


3
4
5
# File 'lib/rito/match.rb', line 3

def season
  @season
end

#teamsObject

Returns the value of attribute teams


3
4
5
# File 'lib/rito/match.rb', line 3

def teams
  @teams
end

#timelineObject

Returns the value of attribute timeline


3
4
5
# File 'lib/rito/match.rb', line 3

def timeline
  @timeline
end

Class Method Details

.by_id(match_id) ⇒ Object


28
29
30
31
32
# File 'lib/rito/match.rb', line 28

def by_id(match_id)
	url = match_url + "/#{match_id}"
	response = call_api(url)
	self.new(response)
end

.by_id_with_timeline(match_id) ⇒ Object


34
35
36
37
38
39
# File 'lib/rito/match.rb', line 34

def by_id_with_timeline(match_id)
	params = { "includeTimeline" => true }
	url = match_url + "/#{match_id}"
	response = call_api(url, params)
	self.new(response)
end

.match_urlObject


41
42
43
# File 'lib/rito/match.rb', line 41

def match_url
	Rito.root_url + "/api/lol/#{Rito.region}/v2.2/match"
end