Sha256: ebb7fd966851cb077081c8670497af2b544f1357763ea713e921eef181d7aa88
Contents?: true
Size: 1.7 KB
Versions: 18
Compression:
Stored size: 1.7 KB
Contents
module Octokit class Client # Methods for API rate limiting info # # @see http://developer.github.com/v3/#rate-limiting module RateLimit # Get rate limit info from last response if available # or make a new request to fetch rate limit # # @see http://developer.github.com/v3/#rate-limiting # @return [Octokit::RateLimit] Rate limit info def rate_limit(options = {}) return rate_limit! if last_response.nil? Octokit::RateLimit.from_response(last_response) end alias ratelimit rate_limit # Get number of rate limted requests remaining # # @see http://developer.github.com/v3/#rate-limiting # @return [Fixnum] Number of requests remaining in this period def rate_limit_remaining(options = {}) puts "Deprecated: Please use .rate_limit.remaining" rate_limit.remaining end alias ratelimit_remaining rate_limit_remaining # Refresh rate limit info by making a new request # # @see http://developer.github.com/v3/#rate-limiting # @return [Octokit::RateLimit] Rate limit info def rate_limit!(options = {}) get "rate_limit" Octokit::RateLimit.from_response(last_response) end alias ratelimit! rate_limit! # Refresh rate limit info and get number of rate limted requests remaining # # @see http://developer.github.com/v3/#rate-limiting # @return [Fixnum] Number of requests remaining in this period def rate_limit_remaining!(options = {}) puts "Deprecated: Please use .rate_limit!.remaining" rate_limit!.remaining end alias ratelimit_remaining! rate_limit_remaining! end end end
Version data entries
18 entries across 18 versions & 1 rubygems