# all files / lib/Endpoints/StaticEndpoints/ StaticSummonerSpellEndpoint.js

81.82% Statements 9/11
100% Branches 0/0
33.33% Functions 1/3
81.82% Lines 9/11

    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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    551×
    1×
    1×

    1×

    1×
    1×

    1×

    1×

    1×
     import StaticSuperclass from './StaticSuperclass'
    import Request from 'RequestClient/Request'
    import METHOD_NAMES from 'Enums/method-names'

    class StaticSummonerSpellEndpoint extends StaticSuperclass {
        constructor(config, limiter) {
            super()

            this.config = config

            this.list = this.list.bind(this)
            this.get = this.get.bind(this)

            this.resourceName = 'summoner-spells'

            this.limiter = limiter
        }

        /**
         * Retrieves summoner spell list.
         *
         * Implements GET `/lol/static-data/v3/summoner-spells`.
         */
        list() {
            return new Request(
                this.config,
                this.serviceName,
                this.resourceName,
                METHOD_NAMES.STATIC.GET_SUMMONER_SPELL_LIST,
                'GET',
                this.limiter,
            )
        }

        /**
         * Retrieves summoner spell by ID.
         *
         * Implements GET `/lol/static-data/v3/summoner-spells/{id}`.
         *
         * @param {number} summonerSpellID - The ID of the summoner spell.
         */
        get(summonerSpellID) {
            return new Request(
                this.config,
                this.serviceName,
                `${this.resourceName}/${summonerSpellID}`,
                METHOD_NAMES.GET_SUMMONER_SPELL_BY_ID,
                'GET',
                this.limiter,
            )
        }
    }

    export default StaticSummonerSpellEndpoint