lib/nicoquery/api/base.rb in nicoquery-0.1.6.1 vs lib/nicoquery/api/base.rb in nicoquery-0.1.7

- old
+ new

@@ -27,19 +27,16 @@ _uri = scheme + "://" + [ ([host, path].join('/')), params].join('?') URI.escape _uri end def get - RestClient.get uri.to_s do |response, request, result, &block| - case response.code - when 200 - @forbidden = false - response - when 403 - @forbidden = true - response - end + res = nil + + RestClient.get uri.to_s do |response| + res = response end + + { body: res.to_s, headers: res.headers, status_code: res.code } end end end end