lib/itrp/client/response.rb in itrp-client-1.1.4 vs lib/itrp/client/response.rb in itrp-client-1.1.5

- old
+ new

@@ -109,9 +109,13 @@ # +true+ if the response is invalid because of throttling def throttled? !!(@response.code.to_s == '429' || (message && message =~ /Too Many Requests/)) end + def retry_after + @current_page ||= @response.header['Retry-After'].to_i + end + def to_s valid? ? json.to_s : message end end