all files / lib/Endpoints/SpectatorEndpoint/ CurrentGameEndpoint.js

87.5% Statements 7/8
100% Branches 0/0
50% Functions 1/2
87.5% Lines 7/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                              
import SpectatorSuperclass from './SpectatorSuperclass'
import Request from 'RequestClient/Request'
import METHOD_NAMES from 'Enums/method-names'
 
class CurrentGameEndpoint extends SpectatorSuperclass {
    constructor(config, limiter) {
        super()
 
        this.config = config
 
        this.by = {
            summonerID: this.summonerID.bind(this),
        }
 
        this.limiter = limiter
    }
 
    /**
     * Get current game information for the given summoner ID.
     *
     * Implements GET `/lol/spectator/v3/active-games/by-summoner/{summonerId}`.
     *
     * @param {number} summonerID - The ID of a summoner.
     */
    summonerID(summonerID) {
        return new Request(
            this.config,
            this.serviceName,
            `active-games/by-summoner/${summonerID}`,
            METHOD_NAMES.SPECTATOR.GET_CURRENT_GAME_INFO_BY_SUMMONER,
            'GET',
            this.limiter,
        )
    }
}
 
export default CurrentGameEndpoint