Class: RiotGamesApi::LOL::Resource::Summoner
- Inherits:
-
Base
- Object
- Base
- RiotGamesApi::LOL::Resource::Summoner
- Defined in:
- lib/riot_games_api/lol/resource/summoner.rb
Instance Method Summary (collapse)
-
- (Array) by_id(summoner_ids)
Return summoners data by summoner id.
-
- (Array) by_name(summoner_names)
Return summoners data by summoner name.
-
- (Summoner) initialize(connection, region)
constructor
A new instance of Summoner.
-
- (Array) masteries(summoner_ids)
Return summoner mastaries by summoner id.
-
- (Array) name(summoner_ids)
Return summoner names by summoner id.
-
- (Array) runes(summoner_ids)
Return summoner runes by summoner id.
Constructor Details
- (Summoner) initialize(connection, region)
Returns a new instance of Summoner
5 6 7 8 |
# File 'lib/riot_games_api/lol/resource/summoner.rb', line 5 def initialize(connection, region) super @version = 'v1.4' end |
Instance Method Details
- (Array) by_id(summoner_ids)
Return summoners data by summoner id
24 25 26 27 28 29 30 |
# File 'lib/riot_games_api/lol/resource/summoner.rb', line 24 def by_id(summoner_ids) neated_param = neat_params(summoner_ids) summoners = get(resource_path_by_id(neated_param), @version) summoners.map do |summoner| RiotGamesApi::LOL::Model::Summoner::Summoner.new(summoner.last) end end |
- (Array) by_name(summoner_names)
Return summoners data by summoner name
13 14 15 16 17 18 19 |
# File 'lib/riot_games_api/lol/resource/summoner.rb', line 13 def by_name(summoner_names) neated_param = neat_params(summoner_names) summoners = get(resource_path_by_name(neated_param), @version) summoners.map do |summoner| RiotGamesApi::LOL::Model::Summoner::Summoner.new(summoner.last) end end |
- (Array) masteries(summoner_ids)
Return summoner mastaries by summoner id
35 36 37 38 39 40 41 42 |
# File 'lib/riot_games_api/lol/resource/summoner.rb', line 35 def masteries(summoner_ids) neated_param = neat_params(summoner_ids) masteries = get(resource_path_by_id('masteries', neated_param), @version) masteries.map do |mastery| RiotGamesApi::LOL::Model::Summoner::MasteryPageList.new(mastery.last) end # { masteries.keys.first.to_i => ) } end |
- (Array) name(summoner_ids)
Return summoner names by summoner id
47 48 49 50 51 52 53 |
# File 'lib/riot_games_api/lol/resource/summoner.rb', line 47 def name(summoner_ids) neated_param = neat_params(summoner_ids) names = get(resource_path_by_id('name', neated_param), @version) names.map do |name| RiotGamesApi::LOL::Model::Summoner::Name.new(id: name.first, name: name.last) end end |
- (Array) runes(summoner_ids)
Return summoner runes by summoner id
58 59 60 61 62 63 64 |
# File 'lib/riot_games_api/lol/resource/summoner.rb', line 58 def runes(summoner_ids) neated_param = neat_params(summoner_ids) runes = get(resource_path_by_id('runes', neated_param), @version) runes.map do |rune| RiotGamesApi::LOL::Model::Summoner::RunePageList.new(rune.last) end end |