class GH::CustomLimit

Adds Client info so even unauthenticated requests can use a custom request limit

Attributes

client_id[RW]
client_secret[RW]

Public Instance Methods

full_url(key) click to toggle source
Calls superclass method
# File lib/gh/custom_limit.rb, line 12
def full_url(key)
  return super unless client_id

  url    = super
  params = url.query_values || {}

  unless params.include? 'client_id'
    params['client_id']     = client_id
    params['client_secret'] = client_secret
  end

  url.query_values = params
  url
end
setup(backend, options) click to toggle source
Calls superclass method
# File lib/gh/custom_limit.rb, line 6
def setup(backend, options)
  @client_id     = options[:client_id]
  @client_secret = options[:client_secret]
  super
end