bridge_api 0.1.17 → 0.1.18

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: 4ad6bf06ea2e371f6bd3be6fc8d32256a018351a
4
- data.tar.gz: 2755f445f2f52a3d74a3e0f8483b2f6fa59f0d42
3
+ metadata.gz: 3d155729be1399137bf80c26acb7fa12f085adca
4
+ data.tar.gz: 4304e22f6b0e0c01190121651b6ce217a7cd3734
5
5
  SHA512:
6
- metadata.gz: 946f41bcd7c178055d0f7510364e6669f29a1d9ef355e0d4aabfaeccf226f97f841071938a5a558b94ee19070e1af6dd72d9afdf5fe68bb36b02a58bf44d75f3
7
- data.tar.gz: aaef2be57e81dff8b59089ac968e11fc5f888ec6c6e7f6ada1119a21f5677b0bd55b8ba3da10360179797ab83630aaddfa77e794dde506642436364d4f66c045
6
+ metadata.gz: 26f631248dbef87cd037628f344abe5f3d79bae4f1320a1ae7c723335a8a941008e4f6de080c8c8f8baa580b3f71551d6db15a539b95f967ea9229907dd7ca0f
7
+ data.tar.gz: 1ffbce8b2cf0cf342e376a71ccf514ab18f139173c3c0a56bfd0263e09c23b13ceb707330d659f978fddc4b4522d2627bfa92ac4e3f9b8f62595e581e2cf3a0b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bridge_api (0.1.16)
4
+ bridge_api (0.1.17)
5
5
  faraday (~> 0.9.0)
6
6
  faraday_middleware (~> 0.9.0)
7
7
  footrest (>= 0.5.1)
@@ -31,11 +31,11 @@ GEM
31
31
  faraday (~> 0.9.0)
32
32
  link_header (>= 0.0.7)
33
33
  hashdiff (0.3.2)
34
- i18n (0.9.1)
34
+ i18n (0.9.3)
35
35
  concurrent-ruby (~> 1.0)
36
36
  link_header (0.0.8)
37
37
  method_source (0.8.2)
38
- minitest (5.11.1)
38
+ minitest (5.11.3)
39
39
  multipart-post (2.0.0)
40
40
  pry (0.10.4)
41
41
  coderay (~> 1.1.0)
@@ -62,7 +62,7 @@ GEM
62
62
  slop (3.6.0)
63
63
  thread_safe (0.3.6)
64
64
  tilt (1.4.1)
65
- tzinfo (1.2.4)
65
+ tzinfo (1.2.5)
66
66
  thread_safe (~> 0.1)
67
67
  webmock (1.22.6)
68
68
  addressable (>= 2.3.6)
@@ -6,7 +6,7 @@ module BridgeAPI
6
6
  @next_page = nil
7
7
  @prev_page = nil
8
8
 
9
- attr_reader :status, :headers, :members
9
+ attr_reader :status, :headers, :members, :body, :errors
10
10
 
11
11
  def self.process_response(response, api_client, result_mapping)
12
12
  ApiArray.new(response, api_client, result_mapping)
@@ -33,9 +33,18 @@ module BridgeAPI
33
33
  when *((200..206).to_a + [302])
34
34
  apply_response_metadata(response)
35
35
  @members = get_response_content(response)
36
+ else
37
+ set_response_vars(response)
36
38
  end
37
39
  end
38
40
 
41
+ def set_response_vars(response)
42
+ @headers = response.headers
43
+ @status= response.status
44
+ @body= response.body
45
+ @errors = response.body['errors'] rescue []
46
+ end
47
+
39
48
  def length
40
49
  @members.length
41
50
  end
@@ -124,9 +133,8 @@ module BridgeAPI
124
133
  @linked = {}
125
134
  @meta = {}
126
135
  end
127
- @status = response.status
128
- @headers = response.headers
129
136
  @method = response.env[:method]
137
+ set_response_vars(response)
130
138
  init_pages(response)
131
139
  init_linked(response)
132
140
  init_meta(response)
@@ -1,3 +1,3 @@
1
1
  module BridgeAPI
2
- VERSION = '0.1.17' unless defined?(BridgeAPI::VERSION)
2
+ VERSION = '0.1.18' unless defined?(BridgeAPI::VERSION)
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridge_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-02 00:00:00.000000000 Z
11
+ date: 2018-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  version: '0'
255
255
  requirements: []
256
256
  rubyforge_project:
257
- rubygems_version: 2.4.8
257
+ rubygems_version: 2.6.14
258
258
  signing_key:
259
259
  specification_version: 4
260
260
  summary: Bridge API
@@ -290,3 +290,4 @@ test_files:
290
290
  - spec/fixtures/users.json
291
291
  - spec/support/fake_bridge.rb
292
292
  - spec/test_helper.rb
293
+ has_rdoc: