lib/get_response/response.rb in get_response-0.1.1 vs lib/get_response/response.rb in get_response-0.1.2
- old
+ new
@@ -11,7 +11,15 @@
end
def success?
[200, 201, 202].include? @response.status
end
+
+ def rate_limitted?
+ @response.status == 429
+ end
+
+ def rate_limit_reset_time
+ @response.headers['x-ratelimit-reset']&.to_i
+ end
end
end