Sha256: 89372854a696061ca2bef8a41e5d95e8151614f5044e8254934f93e3a11b6bb7

Contents?: true

Size: 869 Bytes

Versions: 12

Compression:

Stored size: 869 Bytes

Contents

module Lol
  class LolStatusRequest < Request

    def self.api_version
      "v1.0"
    end

    def initialize region = nil, cache_store = {}
      super nil, region, cache_store
    end

    # Returns a list of each shard status
    # This special call works against all regions
    # @return [Array] an array of DynamicModel representing the response
    def shards
      perform_request(api_url('shards')).map do |shard_data|
        DynamicModel.new shard_data
      end
    end

    # Returns a detailed status of the current shard
    # @return [DynamicModel]
    def current_shard
      shard_data = perform_request(api_url('shards', region))
      DynamicModel.new shard_data
    end

    def api_url path, params = {}
      "http://status.leagueoflegends.com/#{path}".tap do |url|
        url << "/#{params}" unless params.empty?
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ruby-lol-0.12.2 lib/lol/lol_status_request.rb
ruby-lol-0.12.1 lib/lol/lol_status_request.rb
ruby-lol-0.12.0 lib/lol/lol_status_request.rb
ruby-lol-0.11.6 lib/lol/lol_status_request.rb
ruby-lol-0.11.5 lib/lol/lol_status_request.rb
ruby-lol-0.11.4 lib/lol/lol_status_request.rb
ruby-lol-0.11.3 lib/lol/lol_status_request.rb
ruby-lol-0.11.2 lib/lol/lol_status_request.rb
ruby-lol-0.11.1 lib/lol/lol_status_request.rb
ruby-lol-0.11.0 lib/lol/lol_status_request.rb
ruby-lol-0.10.0 lib/lol/lol_status_request.rb
ruby-lol-0.9.19.1 lib/lol/lol_status_request.rb