class BlizzardApi::Starcraft::Request
Starcraft
requests
Constants
- SC_REGION
Possible regions for the SC II API (Except China)
Public Class Methods
new(region = nil, mode = :regular)
click to toggle source
@!macro regions
Calls superclass method
BlizzardApi::Request::new
# File lib/blizzard_api/starcraft/request.rb, line 18 def initialize(region = nil, mode = :regular) super region, mode @game = 'sc2' end
Private Instance Methods
resolve_region(region_arg)
click to toggle source
Helper method to find a region_id by its symbol
# File lib/blizzard_api/starcraft/request.rb, line 27 def resolve_region(region_arg) return region_arg if region_arg.is_a? Integer return SC_REGION[region_arg] if region_arg.is_a? Symbol raise ArgumentError, 'Invalid region, please read the documentation' end