module Ohanakapa::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 ohanapi.herokuapp.com/api/docs @return [Ohanakapa::RateLimit] Rate limit info
# File lib/ohanakapa/client/rate_limit.rb, line 14 def rate_limit(options = {}) return rate_limit! if last_response.nil? Ohanakapa::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 ohanapi.herokuapp.com/api/docs @return [Ohanakapa::RateLimit] Rate limit info
# File lib/ohanakapa/client/rate_limit.rb, line 26 def rate_limit!(options = {}) get "rate_limit" Ohanakapa::RateLimit.from_response(last_response) end
Also aliased as: ratelimit!