Module: Octokit::Client::RateLimit
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/rate_limit.rb |
Overview
Methods for API rate limiting info
Instance Method Summary
-
#rate_limit(_options = {}) ⇒ Octokit::RateLimit
(also: #ratelimit)
Get rate limit info from last response if available or make a new request to fetch rate limit.
-
#rate_limit!(_options = {}) ⇒ Octokit::RateLimit
(also: #ratelimit!)
Refresh rate limit info by making a new request.
-
#rate_limit_remaining(_options = {}) ⇒ Integer
(also: #ratelimit_remaining)
Get number of rate limted requests remaining.
-
#rate_limit_remaining!(_options = {}) ⇒ Integer
(also: #ratelimit_remaining!)
Refresh rate limit info and get number of rate limted requests remaining.
-
#ratelimit(_options = {})
Alias for #rate_limit.
-
#ratelimit!(_options = {})
Alias for #rate_limit!.
-
#ratelimit_remaining(_options = {})
Alias for #rate_limit_remaining.
-
#ratelimit_remaining!(_options = {})
Alias for #rate_limit_remaining!.
Instance Method Details
#rate_limit(_options = {}) ⇒ Octokit::RateLimit Also known as: #ratelimit
Get rate limit info from last response if available or make a new request to fetch rate limit
# File 'lib/octokit/client/rate_limit.rb', line 14
def rate_limit( = {}) return rate_limit! if last_response.nil? Octokit::RateLimit.from_response(last_response) end
#rate_limit!(_options = {}) ⇒ Octokit::RateLimit Also known as: #ratelimit!
Refresh rate limit info by making a new request
# File 'lib/octokit/client/rate_limit.rb', line 35
def rate_limit!( = {}) get 'rate_limit' Octokit::RateLimit.from_response(last_response) end
#rate_limit_remaining(_options = {}) ⇒ Integer
Also known as: #ratelimit_remaining
Get number of rate limted requests remaining
# File 'lib/octokit/client/rate_limit.rb', line 25
def rate_limit_remaining( = {}) octokit_warn 'Deprecated: Please use .rate_limit.remaining' rate_limit.remaining end
#rate_limit_remaining!(_options = {}) ⇒ Integer
Also known as: #ratelimit_remaining!
Refresh rate limit info and get number of rate limted requests remaining
# File 'lib/octokit/client/rate_limit.rb', line 45
def rate_limit_remaining!( = {}) octokit_warn 'Deprecated: Please use .rate_limit!.remaining' rate_limit!.remaining end
#ratelimit(_options = {})
Alias for #rate_limit.
# File 'lib/octokit/client/rate_limit.rb', line 19
alias ratelimit rate_limit
#ratelimit!(_options = {})
Alias for #rate_limit!.
# File 'lib/octokit/client/rate_limit.rb', line 39
alias ratelimit! rate_limit!
#ratelimit_remaining(_options = {})
Alias for #rate_limit_remaining.
# File 'lib/octokit/client/rate_limit.rb', line 29
alias ratelimit_remaining rate_limit_remaining
#ratelimit_remaining!(_options = {})
Alias for #rate_limit_remaining!.
# File 'lib/octokit/client/rate_limit.rb', line 49
alias ratelimit_remaining! rate_limit_remaining!