class Starcall::Regions
This class is used to list and validate regions.
Public Class Methods
list()
click to toggle source
A list of valid Riot Regions
.
# File lib/starcall/regions.rb, line 7 def self.list [ 'br', # Brazil 'eune', # EU North East 'euw', # EU West 'lan', # Latin America North 'las', # Latin America South 'na', # North America 'oce', # Oceania 'ru', # Russia 'tr', # Turkey 'jp', # Japan 'kr' # Korea ] end
valid?(region:)
click to toggle source
A method to check is the region is valid, if not, raise an error.
# File lib/starcall/regions.rb, line 24 def self.valid?(region:) return true if list.include? region raise Starcall::Errors::InvalidRegion.new(region: region) end