From 86f5765fa26b3559445c2325bb685cb35caed26a Mon Sep 17 00:00:00 2001 From: Jonathan Hyman Date: Wed, 10 Aug 2016 14:06:36 -0400 Subject: [PATCH 1/2] Have Common#retrieve_with_timestamps support HTTParty::Response objects since that is what HTTParty returns as of 0.13.x --- lib/sendgrid_toolkit/common.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/sendgrid_toolkit/common.rb b/lib/sendgrid_toolkit/common.rb index 275f45f..e740a4c 100644 --- a/lib/sendgrid_toolkit/common.rb +++ b/lib/sendgrid_toolkit/common.rb @@ -10,7 +10,10 @@ def retrieve(options = {}) def retrieve_with_timestamps(options = {}) options.merge! :date => 1 response = retrieve options - if response.is_a? Array + if response.is_a? HTTParty::Response + response = response.parsed_response + end + if response.is_a?(Array) response.each do |message| parse_message_time message end @@ -40,4 +43,4 @@ def parse_message_time(message) end -end \ No newline at end of file +end From 53df00539ac050aa1f2c82e15797fbd220e42ab4 Mon Sep 17 00:00:00 2001 From: Jonathan Hyman Date: Wed, 10 Aug 2016 14:11:58 -0400 Subject: [PATCH 2/2] Fix style to be consistent. --- lib/sendgrid_toolkit/common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sendgrid_toolkit/common.rb b/lib/sendgrid_toolkit/common.rb index e740a4c..2348654 100644 --- a/lib/sendgrid_toolkit/common.rb +++ b/lib/sendgrid_toolkit/common.rb @@ -13,7 +13,7 @@ def retrieve_with_timestamps(options = {}) if response.is_a? HTTParty::Response response = response.parsed_response end - if response.is_a?(Array) + if response.is_a? Array response.each do |message| parse_message_time message end