lib/recurly/http.rb in recurly-3.4.1 vs lib/recurly/http.rb in recurly-3.5.0
- old
+ new
@@ -2,18 +2,19 @@
module HTTP
class Response
attr_accessor :status, :body, :request,
:request_id, :rate_limit, :rate_limit_remaining,
:rate_limit_reset, :date, :proxy_metadata,
- :content_type
+ :content_type, :total_records
def initialize(resp, request)
@request = Request.new(request.method, request.path, request.body)
@status = resp.code.to_i
@request_id = resp["x-request-id"]
@rate_limit = resp["x-ratelimit-limit"].to_i
@rate_limit_remaining = resp["x-ratelimit-remaining"].to_i
@rate_limit_reset = Time.at(resp["x-ratelimit-reset"].to_i).to_datetime
+ @total_records = resp["recurly-total-records"]&.to_i
if resp["content-type"]
@content_type = resp["content-type"].split(";").first
else
@content_type = resp.content_type
end