Class: RiotGamesApi::LOL::Resource::League
- Defined in:
- lib/riot_games_api/lol/resource/league.rb
Instance Method Summary collapse
- #by_summoner_id(summoner_id) ⇒ Object
- #by_summoner_id_only_own_entry(summoner_id) ⇒ Object
- #by_team_id(team_id) ⇒ Object
- #by_team_id_only_own_entry(team_id) ⇒ Object
- #challenger_solo_5v5 ⇒ Object
- #challenger_team_3v3 ⇒ Object
- #challenger_team_5v5 ⇒ Object
-
#initialize(connection, region) ⇒ League
constructor
A new instance of League.
Constructor Details
#initialize(connection, region) ⇒ League
Returns a new instance of League.
5 6 7 8 |
# File 'lib/riot_games_api/lol/resource/league.rb', line 5 def initialize(connection, region) super @version = 'v2.3' end |
Instance Method Details
#by_summoner_id(summoner_id) ⇒ Object
10 11 12 13 14 |
# File 'lib/riot_games_api/lol/resource/league.rb', line 10 def by_summoner_id(summoner_id) get(resource_path('by-summoner', summoner_id), @version).map do |league| RiotGamesApi::LOL::Model::League::League.new league end end |
#by_summoner_id_only_own_entry(summoner_id) ⇒ Object
16 17 18 19 20 |
# File 'lib/riot_games_api/lol/resource/league.rb', line 16 def by_summoner_id_only_own_entry(summoner_id) get(resource_path('by-summoner', summoner_id, true), @version).map do |league_item| RiotGamesApi::LOL::Model::League::LeagueItem.new league_item end end |
#by_team_id(team_id) ⇒ Object
22 23 24 25 26 |
# File 'lib/riot_games_api/lol/resource/league.rb', line 22 def by_team_id(team_id) get(resource_path('by-team', team_id), @version).map do |league| RiotGamesApi::LOL::Model::League::League.new league end end |
#by_team_id_only_own_entry(team_id) ⇒ Object
28 29 30 31 32 |
# File 'lib/riot_games_api/lol/resource/league.rb', line 28 def by_team_id_only_own_entry(team_id) get(resource_path('by-team', team_id, true), @version).map do |league_item| RiotGamesApi::LOL::Model::League::LeagueItem.new league_item end end |
#challenger_solo_5v5 ⇒ Object
34 35 36 37 |
# File 'lib/riot_games_api/lol/resource/league.rb', line 34 def challenger_solo_5v5 league = get(resource_path_by_challenger, @version, type: 'RANKED_SOLO_5x5') RiotGamesApi::LOL::Model::League::League.new league end |
#challenger_team_3v3 ⇒ Object
44 45 46 47 |
# File 'lib/riot_games_api/lol/resource/league.rb', line 44 def challenger_team_3v3 league = get(resource_path_by_challenger, @version, type: 'RANKED_TEAM_3x3') RiotGamesApi::LOL::Model::League::League.new league end |
#challenger_team_5v5 ⇒ Object
39 40 41 42 |
# File 'lib/riot_games_api/lol/resource/league.rb', line 39 def challenger_team_5v5 league = get(resource_path_by_challenger, @version, type: 'RANKED_TEAM_5x5') RiotGamesApi::LOL::Model::League::League.new league end |