Class: RiotGamesApi::LOL::Resource::Team
- Defined in:
- lib/riot_games_api/lol/resource/team.rb
Instance Method Summary collapse
-
#by_summoner_id(summoner_ids) ⇒ TeamList
Return team data by summoner id.
-
#by_team_id(team_ids) ⇒ Array
Return team data by team id.
-
#initialize(connection, region) ⇒ Team
constructor
A new instance of Team.
Constructor Details
#initialize(connection, region) ⇒ Team
Returns a new instance of Team.
5 6 7 8 |
# File 'lib/riot_games_api/lol/resource/team.rb', line 5 def initialize(connection, region) super @version = 'v2.4' end |
Instance Method Details
#by_summoner_id(summoner_ids) ⇒ TeamList
Return team data by summoner id
13 14 15 16 17 18 19 |
# File 'lib/riot_games_api/lol/resource/team.rb', line 13 def by_summoner_id(summoner_ids) neated_param = neat_params(summoner_ids) teams_by_player = get(resource_path(neated_param, true), @version) teams_by_player.map do |team| RiotGamesApi::LOL::Model::Team::TeamList.new(id: team.first, teams: team.last) end end |
#by_team_id(team_ids) ⇒ Array
Return team data by team id
24 25 26 27 28 29 30 31 |
# File 'lib/riot_games_api/lol/resource/team.rb', line 24 def by_team_id(team_ids) neated_param = neat_params(team_ids) teams = get(resource_path(neated_param), @version) # team_key = team.keys.first.gsub(/team/, 'TEAM').gsub(/_/, '-') # undo rashify teams.map do |team| { team.first => RiotGamesApi::LOL::Model::Team::Team.new(team.last) } end end |