module Octokit::Client::RateLimit

Methods for API rate limiting info

@see developer.github.com/v3/#rate-limiting

Public Instance Methods

rate_limit(_options = {}) click to toggle source

Get rate limit info from last response if available or make a new request to fetch rate limit

@see developer.github.com/v3/rate_limit/#rate-limit @return [Octokit::RateLimit] Rate limit info

# File lib/octokit/client/rate_limit.rb, line 14
def rate_limit(_options = {})
  return rate_limit! if last_response.nil?

  Octokit::RateLimit.from_response(last_response)
end
Also aliased as: ratelimit
rate_limit!(_options = {}) click to toggle source

Refresh rate limit info by making a new request

@see developer.github.com/v3/rate_limit/#rate-limit @return [Octokit::RateLimit] Rate limit info

# File lib/octokit/client/rate_limit.rb, line 35
def rate_limit!(_options = {})
  get 'rate_limit'
  Octokit::RateLimit.from_response(last_response)
end
Also aliased as: ratelimit!
rate_limit_remaining(_options = {}) click to toggle source

Get number of rate limted requests remaining

@see developer.github.com/v3/rate_limit/#rate-limit @return [Integer] Number of requests remaining in this period

# File lib/octokit/client/rate_limit.rb, line 25
def rate_limit_remaining(_options = {})
  octokit_warn 'Deprecated: Please use .rate_limit.remaining'
  rate_limit.remaining
end
Also aliased as: ratelimit_remaining
rate_limit_remaining!(_options = {}) click to toggle source

Refresh rate limit info and get number of rate limted requests remaining

@see developer.github.com/v3/rate_limit/#rate-limit @return [Integer] Number of requests remaining in this period

# File lib/octokit/client/rate_limit.rb, line 45
def rate_limit_remaining!(_options = {})
  octokit_warn 'Deprecated: Please use .rate_limit!.remaining'
  rate_limit!.remaining
end
Also aliased as: ratelimit_remaining!
ratelimit(_options = {})
Alias for: rate_limit
ratelimit!(_options = {})
Alias for: rate_limit!
ratelimit_remaining(_options = {})
ratelimit_remaining!(_options = {})