john-mayer 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/foursquare.rb CHANGED
@@ -15,13 +15,13 @@ module Foursquare
15
15
  class Error < StandardError ; end
16
16
 
17
17
  ERRORS = {
18
- "invalid_auth" => "OAuth token was not provided or was invalid."
19
- "param_error" => "A required parameter was missing or a parameter was malformed. This is also used if the resource ID in the path is incorrect."
20
- "endpoint_error" => "The requested path does not exist."
21
- "not_authorized" => "Although authentication succeeded, the acting user is not allowed to see this information due to privacy restrictions."
22
- "rate_limit_exceeded" => "Rate limit for this hour exceeded."
23
- "deprecated" => "Something about this request is using deprecated functionality, or the response format may be about to change."
24
- "server_error" => "Server is currently experiencing issues. Check status.foursquare.com for udpates."
18
+ "invalid_auth" => "OAuth token was not provided or was invalid.",
19
+ "param_error" => "A required parameter was missing or a parameter was malformed. This is also used if the resource ID in the path is incorrect.",
20
+ "endpoint_error" => "The requested path does not exist.",
21
+ "not_authorized" => "Although authentication succeeded, the acting user is not allowed to see this information due to privacy restrictions.",
22
+ "rate_limit_exceeded" => "Rate limit for this hour exceeded.",
23
+ "deprecated" => "Something about this request is using deprecated functionality, or the response format may be about to change.",
24
+ "server_error" => "Server is currently experiencing issues. Check status.foursquare.com for udpates.",
25
25
  "other" => "Some other type of error occurred."
26
26
  }
27
27
  end
@@ -21,7 +21,7 @@ module Foursquare
21
21
  def get(path, params={})
22
22
  params.merge!(:oauth_token => @access_token)
23
23
  response = JSON.parse(Typhoeus::Request.get(API + path, :params => params).body)
24
- response["meta"]["code"] == 200 ? response["response"] : error(response)
24
+ response["meta"]["errorType"] ? error(response) : response["response"]
25
25
  end
26
26
 
27
27
  private
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: john-mayer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Nakajima