From 8b1b62a7c2720a3f14c5d70801a45bd120823026 Mon Sep 17 00:00:00 2001 From: Jearvon Dharrie Date: Sun, 15 Feb 2015 15:09:32 -0500 Subject: [PATCH 1/2] Rely on success method on response instead of checking status code --- lib/zero_push/client.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/zero_push/client.rb b/lib/zero_push/client.rb index 4fc228e..e9b55ba 100644 --- a/lib/zero_push/client.rb +++ b/lib/zero_push/client.rb @@ -16,8 +16,7 @@ def initialize(auth_token) # # @return [Boolean] def verify_credentials - response = http.get('/verify_credentials') - response.status == 200 + http.get('/verify_credentials').success? end # Sends a notification to the list of devices From 1ca9e01a09504d72be1e795eba795f0f10b255eb Mon Sep 17 00:00:00 2001 From: Jearvon Dharrie Date: Sun, 15 Feb 2015 15:41:46 -0500 Subject: [PATCH 2/2] Use more ruby like syntax for initialize method --- lib/zero_push/client.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/zero_push/client.rb b/lib/zero_push/client.rb index e9b55ba..f828d5e 100644 --- a/lib/zero_push/client.rb +++ b/lib/zero_push/client.rb @@ -8,7 +8,8 @@ class Client attr_accessor :auth_token def initialize(auth_token) - self.auth_token = auth_token + @auth_token = auth_token + self.extend(Compatibility) end