Sha256: 16423fe5ff555c22b8b392504b521ed0016d187d7a581f0d030114bd8ae51bbd

Contents?: true

Size: 628 Bytes

Versions: 1

Compression:

Stored size: 628 Bytes

Contents

module Lolxin
  class FeaturedGames
    BASE_ENDPOINT = "https://%s.api.pvp.net/observer-mode/rest/featured"

    attr_accessor :conn

    def initialize(options = {})
      region   = options[:region]
      api_key  = options[:api_key]
      endpoint = BASE_ENDPOINT % [region]
      @conn    = Faraday.new(endpoint, options[:conn_options]) do |faraday|
        faraday.request(:url_encoded)
        faraday.response(:logger)
        faraday.adapter(Faraday.default_adapter)
        faraday.params[:api_key] = api_key
      end
    end

    def observe(params = {}, &block)
      conn.get("", params, &block)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lolxin-0.12.1 lib/lolxin/featured_games.rb