class BN::API::SC3
The the StarCraft 3 API
requester.
Public Instance Methods
Request achievements.
@return [HTTPI::Response]
# File lib/bn/api/sc2.rb, line 54 def achievements get("/sc2/data/achievements") end
Request a ladder.
@param [#to_h] options @option options [#to_s] :id The ID of the ladder. @return [HTTPI::Response]
# File lib/bn/api/sc2.rb, line 45 def ladder(options={}) options = options.to_h get("/sc2/ladder/#{options[:id]}") end
Request a profile’s ladders.
@param [#to_h] options @option options [#to_s] :id The ID of the profile. @option options [#to_s] :region The region of the profile. @option options [#to_s] :name The name of the profile @return [HTTPI::Response]
# File lib/bn/api/sc2.rb, line 25 def ladders(options={}) get(profile_uri(options, "ladders")) end
Request a profile’s matches.
@param [#to_h] options @option options [#to_s] :id The ID of the profile. @option options [#to_s] :region The region of the profile. @option options [#to_s] :name The name of the profile @return [HTTPI::Response]
# File lib/bn/api/sc2.rb, line 36 def matches(options={}) get(profile_uri(options, "matches")) end
Request a profile.
@param [#to_h] options @option options [#to_s] :id The ID of the profile. @option options [#to_s] :region The region of the profile. @option options [#to_s] :name The name of the profile @return [HTTPI::Response]
# File lib/bn/api/sc2.rb, line 14 def profile(options={}) get(profile_uri(options)) end
Protected Instance Methods
# File lib/bn/api/sc2.rb, line 67 def profile_uri(options, path=nil) options = options.to_h "/sc2/profile/#{options[:id]}/#{options[:region]}/#{options[:name]}#{"/#{path}" unless path.nil?}" end