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 +4 -4
- data/Gemfile.lock +4 -4
- data/lib/bridge_api/api_array.rb +11 -3
- data/lib/bridge_api/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d155729be1399137bf80c26acb7fa12f085adca
|
4
|
+
data.tar.gz: 4304e22f6b0e0c01190121651b6ce217a7cd3734
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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.
|
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.
|
65
|
+
tzinfo (1.2.5)
|
66
66
|
thread_safe (~> 0.1)
|
67
67
|
webmock (1.22.6)
|
68
68
|
addressable (>= 2.3.6)
|
data/lib/bridge_api/api_array.rb
CHANGED
@@ -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)
|
data/lib/bridge_api/version.rb
CHANGED
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.
|
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-
|
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.
|
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:
|