xing_api 0.3 → 0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/xing_api/error.rb +4 -3
- data/lib/xing_api/response_handler.rb +3 -3
- data/lib/xing_api/user.rb +4 -0
- data/lib/xing_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1a7be94fd7c7d55947d9312898b59f59a839143
|
4
|
+
data.tar.gz: 403855b22b5df86e265d047218d252c4debde1cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c6e1c632c694727f8c993b994842d8e9264c8b3a9dfe4c492dd9ca4008367b0bc285b80bae2d4b8a7e64e90d3aabd4838bd3e2104a00b92c40950ed17168c7b
|
7
|
+
data.tar.gz: a0d8fae6f888e946dadb664bcff1e6a28319abdd4950c5fef98c6bbe4a0b38b37d4b2173da416ad7a0a25218649a649a7b2736b622caab28a87ea88002ebc01b
|
data/lib/xing_api/error.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
module XingApi
|
2
2
|
class Error < StandardError
|
3
|
-
attr_reader :status_code, :name, :text
|
3
|
+
attr_reader :status_code, :name, :text, :errors
|
4
4
|
|
5
|
-
def initialize(status_code, name = '', text = '')
|
5
|
+
def initialize(status_code, name = '', text = '', errors = [])
|
6
6
|
@status_code = status_code
|
7
7
|
@name = name
|
8
8
|
@text = text
|
9
|
+
@errors = errors || []
|
9
10
|
super(text)
|
10
11
|
end
|
11
12
|
|
12
13
|
def to_s
|
13
|
-
[status_code, name, text].join(' - ')
|
14
|
+
[status_code, name, text, errors.to_s].join(' - ')
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
@@ -32,7 +32,7 @@ module XingApi
|
|
32
32
|
body = parse_json(response)
|
33
33
|
error_class = failed_response_for(status_code, body[:error_name])
|
34
34
|
|
35
|
-
fail error_class.new(status_code, body[:error_name], body[:message])
|
35
|
+
fail error_class.new(status_code, body[:error_name], body[:message], body[:errors])
|
36
36
|
end
|
37
37
|
|
38
38
|
def failed_response_for(status_code, error_name)
|
@@ -48,10 +48,10 @@ module XingApi
|
|
48
48
|
|
49
49
|
def unauthorized_response_for(error_name)
|
50
50
|
case error_name
|
51
|
-
when *OAUTH_ERROR_RESPONSES
|
52
|
-
XingApi::OauthError
|
53
51
|
when 'INVALID_OAUTH_TOKEN'
|
54
52
|
XingApi::InvalidOauthTokenError
|
53
|
+
when *OAUTH_ERROR_RESPONSES
|
54
|
+
XingApi::OauthError
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
data/lib/xing_api/user.rb
CHANGED
data/lib/xing_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xing_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Schmidt
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth
|