class Lolxin::Match
Attributes
endpoint[RW]
Public Class Methods
new(options = {})
click to toggle source
TODO: many endpoints to change and many DTOs to add
Calls superclass method
# File lib/lolxin/api/match.rb, line 6 def initialize(options = {}) super @endpoint = "match/%{version}" % {version: @version} end
Public Instance Methods
by_account(account_id, recent = false)
click to toggle source
# File lib/lolxin/api/match.rb, line 16 def by_account(account_id, recent = false) url = if recent "#{endpoint}/matchlists/by-account/#{account_id}/recent" else "#{endpoint}/matchlists/by-account/#{account_id}" end conn.get(url) end
by_match(match_id)
click to toggle source
# File lib/lolxin/api/match.rb, line 26 def by_match(match_id) url = "#{endpoint}/timelines/by-match/#{match_id}" conn.get(url) end
matches(match_id)
click to toggle source
# File lib/lolxin/api/match.rb, line 11 def matches(match_id) url = "#{endpoint}/matches/#{match_id}" conn.get(url) end
tournament_code(tournament_code, match_id)
click to toggle source
# File lib/lolxin/api/match.rb, line 31 def tournament_code(tournament_code, match_id) url = if tournament_code && match_id "matches/by-tournament-code/#{tournament_code}/ids" else "matches/#{match_id}/by-tournament-code/#{tournament_code}" end conn.get(url) end