all files / lib/Endpoints/LeagueEndpoint/ LeagueEndpointV4.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 39 40 41                                                                    
import LeagueSuperclass from './LeagueSuperclass'
import Request from 'RequestClient/Request'
import METHOD_NAMES from 'Enums/method-names'
 
class LeagueEndpointV4 extends LeagueSuperclass {
    constructor(config, limiter) {
        super()
 
        this.config = config
 
        this.by = {
            uuid: this.uuid.bind(this),
        }
 
        this.limiter = limiter
    }
 
    /**
     * Get league with given ID, including inactive entries.
     *
     * Implements GET `/lol/league/v4/leagues/{leagueId}`.
     *
     * @param {string} leagueUUID - The UUID of the league.
     */
    uuid(leagueUUID) {
        return new Request(
            this.config,
            this.serviceName,
            `leagues/${leagueUUID}`,
            METHOD_NAMES.LEAGUE.GET_LEAGUE_BY_ID_V4,
            'GET',
            this.limiter,
            null,
            false,
            4,
        )
    }
}
 
export default LeagueEndpointV4