Sha256: 7500a6960e4588f70c6b20a588ee6fc76fe595fa47c31a0ecde9df710dddfb43

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

require_relative 'base'
require_relative 'endpoint_template'
module Taric
  module Operation
    module Summoner
      include Taric::Operation::Base

      RUNES_AND_MASTERIES_BASE = "https://{host}/api/lol/{region}/v1.4/summoner/{summonerIds}"
      RUNES =  EndpointTemplate.new(template_url: "#{RUNES_AND_MASTERIES_BASE}/runes{?api_key}")

      # Runes keyed by summoner ID.
      #
      # @param summoner_ids [String] comma separated list of Summoner IDs
      # @return [Hash] runes by Summoner ID
      def summoner_runes(summoner_ids:)
        response_for RUNES, {summonerIds: summoner_ids}
      end

      BASE_SUMMONER_URL = "https://{host}/lol/summoner/v3/summoners"
      SUMMONER_BY_ID = EndpointTemplate.new(template_url: "#{BASE_SUMMONER_URL}/{summonerId}{?api_key}")
      SUMMONER_BY_NAME = EndpointTemplate.new(template_url: "#{BASE_SUMMONER_URL}/by-name/{summonerName}{?api_key}")
      SUMMONER_BY_ACCOUNT_ID = EndpointTemplate.new(template_url: "#{BASE_SUMMONER_URL}/by-account/{accountId}{?api_key}")

      def summoner_by_id(summoner_id:)
        response_for SUMMONER_BY_ID, {summonerId: summoner_id}
      end

      def summoner_by_name(summoner_name:)
        response_for SUMMONER_BY_NAME, {summonerName: summoner_name}
      end

      def summoner_by_account_id(account_id:)
        response_for SUMMONER_BY_ACCOUNT_ID, {accountId: account_id}
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
taric-1.0.0.pre.alpha.4 lib/taric/operation/summoner.rb