xing_api 0.6 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac73392397affd053a94d0096fdfbef820db5205
4
- data.tar.gz: d836f131f9ab49b7d6bd91e431b0296e53b640ea
3
+ metadata.gz: 34c9fc211d757ecb17987b8d907fdc465d6ca803
4
+ data.tar.gz: 60c44eb5cb7b1acfee80ede5a90101954b2e95d0
5
5
  SHA512:
6
- metadata.gz: a169fa335b000d2400d5c7afa3c4afc2fe87d0f3b6f40561f07dcfedee9d9fc0dc29cb43c24175207333bffb448ac626b12ec6e3940b7c05ee7904e813a536e3
7
- data.tar.gz: 70b8ff977812c6826e38339ba9525fe6175efc0526f30e1f17ced85d748adbec78ef1d6226e90852d744c930ae83b05aef785efe2de4b21cfa2f2cfd004f0b85
6
+ metadata.gz: 7fcecb506f7808e59c9f12f1f25e3189fb0c7142ff6ac03f8f89ef5f3d12af8a05963a4a0dc18719137ccaf162dee282a86654dc3af8c8623240ce17f3ca408e
7
+ data.tar.gz: a7725b1b51bde1e576848cd7290430c4f4abd0e5a3eae8c1431aa5654020e0f10effbb2f1d907a8788912652d2d6366a2a8f720b25dc9a72ad08c655be36f5bf
@@ -0,0 +1,20 @@
1
+ require 'delegate'
2
+
3
+ module XingApi
4
+ class Response < SimpleDelegator
5
+ attr_reader :headers
6
+
7
+ def initialize(body, headers)
8
+ @headers = headers
9
+
10
+ body =
11
+ begin
12
+ JSON.parse(body, symbolize_names: true)
13
+ rescue JSON::ParserError
14
+ {}
15
+ end
16
+
17
+ super(body)
18
+ end
19
+ end
20
+ end
@@ -20,9 +20,10 @@ module XingApi
20
20
  raise_failed_response!(response)
21
21
  end
22
22
 
23
- JSON.parse(response.body.to_s, symbolize_names: true)
24
- rescue JSON::ParserError
25
- {}
23
+ Response.new(
24
+ response.body.to_s,
25
+ response.to_hash
26
+ )
26
27
  end
27
28
 
28
29
  private
@@ -1,3 +1,3 @@
1
1
  module XingApi
2
- VERSION = '0.6' unless defined?(XingApi::VERSION)
2
+ VERSION = '0.7' unless defined?(XingApi::VERSION)
3
3
  end
data/lib/xing_api.rb CHANGED
@@ -3,6 +3,7 @@ require 'oauth/signature/plaintext'
3
3
  require 'json'
4
4
 
5
5
  require 'xing_api/response_handler'
6
+ require 'xing_api/response'
6
7
  require 'xing_api/client'
7
8
  require 'xing_api/base'
8
9
  require 'xing_api/error'
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.6'
4
+ version: '0.7'
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: 2016-11-14 00:00:00.000000000 Z
12
+ date: 2017-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth
@@ -124,6 +124,7 @@ files:
124
124
  - lib/xing_api/news/page/article.rb
125
125
  - lib/xing_api/profile_message.rb
126
126
  - lib/xing_api/profile_visit.rb
127
+ - lib/xing_api/response.rb
127
128
  - lib/xing_api/response_handler.rb
128
129
  - lib/xing_api/user.rb
129
130
  - lib/xing_api/user/birth_date.rb