Class: RiotGamesApi::LOL::Resource::Champion
- Inherits:
-
Base
- Object
- Base
- RiotGamesApi::LOL::Resource::Champion
- Defined in:
- lib/riot_games_api/lol/resource/champion.rb
Instance Method Summary (collapse)
-
- (Array) all
Return all champions data which is active, free to play etc.
-
- (Champion) by_champion_id(champion_id)
Return specific champions data by id.
-
- (Array) free
Return free-to-play champions data.
-
- (Champion) initialize(connection, region)
constructor
A new instance of Champion.
Constructor Details
- (Champion) initialize(connection, region)
Returns a new instance of Champion
5 6 7 8 |
# File 'lib/riot_games_api/lol/resource/champion.rb', line 5 def initialize(connection, region) super @version = 'v1.2' end |
Instance Method Details
- (Array) all
Return all champions data which is active, free to play etc.
12 13 14 15 16 |
# File 'lib/riot_games_api/lol/resource/champion.rb', line 12 def all get(resource_path, @version).champions.map do |champion| RiotGamesApi::LOL::Model::Champion::Champion.new champion end end |
- (Champion) by_champion_id(champion_id)
Return specific champions data by id
28 29 30 31 |
# File 'lib/riot_games_api/lol/resource/champion.rb', line 28 def by_champion_id(champion_id) champion = get(resource_path(champion_id), @version) RiotGamesApi::LOL::Model::Champion::Champion.new champion end |
- (Array) free
Return free-to-play champions data
20 21 22 23 24 |
# File 'lib/riot_games_api/lol/resource/champion.rb', line 20 def free get(resource_path, @version, freeToPlay: true).champions.map do |champion| RiotGamesApi::LOL::Model::Champion::Champion.new champion end end |