Skip to content

Commit

Permalink
cleanup (#32)
Browse files Browse the repository at this point in the history
* cleanup

* version bump
  • Loading branch information
josephyi committed Apr 30, 2017
1 parent 18aaf14 commit 2e45d80
Show file tree
Hide file tree
Showing 19 changed files with 6 additions and 2,431 deletions.
6 changes: 0 additions & 6 deletions lib/taric/operation/api.rb
Expand Up @@ -7,10 +7,7 @@
require_relative 'match'
require_relative 'runes'
require_relative 'spectator'
require_relative 'stats'
require_relative 'summoner'
require_relative 'team'
require_relative 'tournament'

# Combines operations of LoL API.
module Taric
Expand All @@ -25,10 +22,7 @@ module API
include Taric::Operation::Match
include Taric::Operation::Runes
include Taric::Operation::Spectator
include Taric::Operation::Stats
include Taric::Operation::Summoner
include Taric::Operation::Team
include Taric::Operation::Tournament

# Template for requesting the url and processing the response.
#
Expand Down
26 changes: 3 additions & 23 deletions lib/taric/operation/league.rb
Expand Up @@ -10,12 +10,10 @@ module League

LEAGUES_BY_SUMMONER_IDS = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/by-summoner/{summonerIds}{?api_key}")
ENTRIES_BY_SUMMONER_IDS = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/by-summoner/{summonerIds}/entry{?api_key}")
LEAGUES_BY_TEAM_IDS = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/by-team/{teamIds}{?api_key}")
ENTRIES_BY_TEAM_IDS = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/by-team/{teamIds}/entry{?api_key}")
CHALLENGER = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/challenger{?api_key,type}")
MASTER = EndpointTemplate.new(template_url: "#{BASE_LEAGUE_URL}/master{?api_key,type}")

CHALLENGER_QUEUE_TYPES = ['RANKED_SOLO_5x5'.freeze, 'RANKED_TEAM_3x3'.freeze, 'RANKED_TEAM_5x5'.freeze].freeze
CHALLENGER_QUEUE_TYPES = ['RANKED_FLEX_SR'.freeze, 'RANKED_FLEX_TT'.freeze, 'RANKED_SOLO_5x5'.freeze, 'RANKED_TEAM_3x3'.freeze, 'RANKED_TEAM_5x5'.freeze].freeze
MASTER_QUEUE_TYPES = CHALLENGER_QUEUE_TYPES

# Leagues by summoner IDs.
Expand Down Expand Up @@ -48,27 +46,9 @@ def league_entries_by_summoner_ids(summoner_ids:)
response_for ENTRIES_BY_SUMMONER_IDS, {summonerIds: summoner_ids}
end

# Leagues by team IDs.
#
# @see https://developer.riotgames.com/api/methods#!/985/3352
# @param team_ids team_ids [String] comma separated list of team ids
# @return [Hash] leagues keyed by team_ids
def leagues_by_team_ids(team_ids:)
response_for LEAGUES_BY_TEAM_IDS, {teamIds: team_ids}
end

# League entries by team IDs.
#
# @see https://developer.riotgames.com/api/methods#!/985/3355
# @param team_ids team_ids [String] comma separated list of team ids
# @return [Hash] league entries keyed by team_ids
def league_entries_by_team_ids(team_ids:)
response_for ENTRIES_BY_TEAM_IDS, {teamIds: team_ids}
end

# Challenger league data for queue type.
#
# @param type [String] required, must be RANKED_SOLO_5x5, RANKED_TEAM_3x3, or RANKED_TEAM_5x5
# @param type [String] required, must be RANKED_FLEX_SR, RANKED_FLEX_TT, RANKED_SOLO_5x5, RANKED_TEAM_3x3, or RANKED_TEAM_5x5
# @return [Hash] challenger league data
# @see https://developer.riotgames.com/api/methods#!/985/3353
def challenger(type: )
Expand All @@ -80,7 +60,7 @@ def challenger(type: )

# Master league data for queue type.
#
# @param type [String] required, must be RANKED_SOLO_5x5, RANKED_TEAM_3x3, or RANKED_TEAM_5x5
# @param type [String] required, must be RANKED_FLEX_SR, RANKED_FLEX_TT, RANKED_SOLO_5x5, RANKED_TEAM_3x3, or RANKED_TEAM_5x5
# @return [Hash] master league data
# https://developer.riotgames.com/api/methods#!/985/3354
def master(type: )
Expand Down
4 changes: 2 additions & 2 deletions lib/taric/operation/match.rb
Expand Up @@ -42,13 +42,13 @@ def matchlist(account_id:, begin_time: nil, end_index: nil, season: nil, champio
MATCHLIST_V3,
{
accountId: account_id,
beginTime: begin_time,
beginTime: epoch_milliseconds(begin_time),
endIndex: end_index,
season: season,
champion: champion,
beginIndex: begin_index,
queue: queue,
endTime: end_time
endTime: epoch_milliseconds(end_time)
}
)
end
Expand Down
34 changes: 0 additions & 34 deletions lib/taric/operation/stats.rb

This file was deleted.

34 changes: 0 additions & 34 deletions lib/taric/operation/team.rb

This file was deleted.

57 changes: 0 additions & 57 deletions lib/taric/operation/tournament.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/taric/version.rb
@@ -1,3 +1,3 @@
module Taric
VERSION = '1.0.0-alpha.8'
VERSION = '1.0.0-beta.0'
end
17 changes: 0 additions & 17 deletions spec/fixtures/league_entries_by_team_ids.json

This file was deleted.

0 comments on commit 2e45d80

Please sign in to comment.