From 273a685a6584f22752670386d4b88051a5cd3d63 Mon Sep 17 00:00:00 2001 From: Matt Lightner Date: Fri, 22 Jul 2011 15:32:39 -0700 Subject: [PATCH 1/2] Added three simple boolean test methods. --- lib/restclient/abstract_response.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/restclient/abstract_response.rb b/lib/restclient/abstract_response.rb index 813e7fba..b1add67f 100644 --- a/lib/restclient/abstract_response.rb +++ b/lib/restclient/abstract_response.rb @@ -11,6 +11,21 @@ def code @code ||= @net_http_res.code.to_i end + # Has the request been made yet + def requested? + !(@net_http_res.blank? rescue true) + end + + # Was there a successful request? + def success? + (requested? && self.return! rescue false) ? true : false + end + + # Was there a failed request? + def failed? + requested? && !success? + end + # A hash of the headers, beautified with symbols and underscores. # e.g. "Content-type" will become :content_type. def headers From f0c0179403458a16db783ff22cc635a0b0e0f55b Mon Sep 17 00:00:00 2001 From: Matt Lightner Date: Fri, 22 Jul 2011 15:36:24 -0700 Subject: [PATCH 2/2] Patch up --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 266146b8..9edc58bb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.3 +1.6.4