module Octokit::Client::RateLimit
Methods for API rate limiting info
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!