From 1900a21a89bc1f05a80047143314ec66b7fe06db Mon Sep 17 00:00:00 2001 From: Fabien Dobat Date: Wed, 27 Apr 2016 16:46:32 +0200 Subject: [PATCH] Add indifferent access to hash response --- lib/polr/api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/polr/api.rb b/lib/polr/api.rb index a990ed0..995d2ef 100644 --- a/lib/polr/api.rb +++ b/lib/polr/api.rb @@ -16,7 +16,7 @@ def self.api_key end def self.process - JSON.parse yield + JSON.parse(yield).with_indifferent_access rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH => e # API unreachable raise Polr::Error.new 'Polr API is unreachable' rescue RestClient::Exception => e # HTTP status error