lib/lol/tournament_request.rb in ruby-lol-1.0.0 vs lib/lol/tournament_request.rb in ruby-lol-1.1.1
- old
+ new
@@ -5,11 +5,11 @@
"/lol/tournament/#{self.class.api_version}"
end
# @!visibility private
def api_base_url
- "https://global.api.riotgames.com"
+ "https://americas.api.riotgames.com"
end
# Creates a tournament provider and returns its ID.
# @param [String] url The provider's callback URL to which tournament game results in this region should be posted. The URL must be well-formed, use the http or https protocol, and use the default port for the protocol
# @return [Integer] Provider ID
@@ -24,13 +24,12 @@
# Creates a tournament and returns its ID.
# @param [Integer] provider_id The provider ID to specify the regional registered provider data to associate this tournament.
# @param [String] name Name of the tournament
# @return [Integer] Tournament ID
def create_tournament provider_id:, name: nil
- body = {
- "providerId" => provider_id,
- "name" => name
- }.compact
+ body = { "providerId" => provider_id, "name" => name }.delete_if do |k, v|
+ v.nil?
+ end
perform_request api_url("tournaments"), :post, body
end
# Create a tournament code for the given tournament.
# @param [Integer] count The number of codes to create (max 1000)