Method: Tenka::Client#calls_left

Defined in:
lib/tenka.rb

#calls_leftObject

Returns the number of calls your API token has left, as well as how many calls you can make before you hit the rate limit for the server.

This information is automatically gathered (whether your API key is valid or not) on every request, so you can also just check Tenka::Client#rate_limit_calls_left and Tenka::Client#api_tokens_left.

Making a request against this endpoint does not reduce the number of API tokens you have left. (It does count towards the rate limit.)

A 404 from this endpoint indicates that your API key is invalid.



118
119
120
121
122
123
124
# File 'lib/tenka.rb', line 118

def calls_left
	ok, body = get('/tokens-remaining')
	ok && {
		rate_limit: rate_limit_calls_left,
		api_limit: api_tokens_left,
	}
end