class LolStatic::Realm

Public Class Methods

new() click to toggle source
# File lib/lol_static/realm.rb, line 6
def initialize
  @mutex = Mutex.new
end

Public Instance Methods

api_version(name=nil) click to toggle source
# File lib/lol_static/realm.rb, line 14
def api_version(name=nil)
  realm_data['n'].has_key?(name.to_s) ? realm_data['n'][name.to_s] : realm_data['v']
end
base_uri() click to toggle source
# File lib/lol_static/realm.rb, line 10
def base_uri
  realm_data['cdn']
end

Private Instance Methods

realm_data() click to toggle source
# File lib/lol_static/realm.rb, line 20
def realm_data
  @mutex.synchronize do
    @realm_data ||= HTTParty.get('http://ddragon.leagueoflegends.com/realms/euw.json').parsed_response
  end
end