Class: MetaNexus::Sc2::Ladder

Inherits:
MetaNexus::Sc2 show all
Defined in:
lib/meta_nexus/sc2/ladder.rb

Class Method Summary collapse

Methods inherited from MetaNexus::Sc2

client, #url

Methods inherited from Api

call_api, #url

Class Method Details

.ladder(id) ⇒ Object

Find Sc2 Ladder info in Battle.net StarCraft 2 Api Required arguments: id - Ladder id

Example:

sc2 = MetaNexus::Sc2::Ladder.new('eu', 'ru_RU', 'api_key')
sc2.ladder(2200)

Response in Hash will contain huge data about top players on ladder.



13
14
15
16
# File 'lib/meta_nexus/sc2/ladder.rb', line 13

def self.ladder(id)
  call_url = "#{client.url}/ladder/#{id}?locale=#{MetaNexus.config.locale}&apikey=#{MetaNexus.config.api_key}"
  MetaNexus::Api.call_api(call_url)
end