class RiotGamesApi::LOL::Resource::Base
Public Class Methods
new(connection, region)
click to toggle source
# File lib/riot_games_api/lol/resource/base.rb, line 5 def initialize(connection, region) @connection = connection @region = region end
Private Instance Methods
api_endpoint(resource_path, version)
click to toggle source
Return api endpoint string @param [String] resource_path @param [String, Integer] version api version @return [String] api endpoint
# File lib/riot_games_api/lol/resource/base.rb, line 25 def api_endpoint(resource_path, version) "api/lol/#{@region}/#{version}/#{resource_path}" end
get(resource_path, version, options = {})
click to toggle source
access api endpoint @param [String] resource_path api endpoint different each resources @param [String, Integer] version api version @param [Hash] options @return [Hashie]
# File lib/riot_games_api/lol/resource/base.rb, line 17 def get(resource_path, version, options = {}) @connection.get(api_endpoint(resource_path, version), options).body end
neat_params(params)
click to toggle source
Return neated string params @param [Array] params @return [String] string joined array and trimed
# File lib/riot_games_api/lol/resource/base.rb, line 32 def neat_params(params) params.join(',').gsub(/\s/, '') end