jf-acceptance 2.2.0 → 2.3.0
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/adapters/base.rb +12 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9c1ca86b4881c76daae122fec415c6ab72be1f5
|
4
|
+
data.tar.gz: 714d1c2a9a747f4a790521ae3d42f295705ab892
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ad86e8bbcad35f8d003e233c66dd580b388d1d476e96f14433955f4ecc3aa5ed902967263e7190d54a907c6b86433eca470c8334a82fc99a030c2d2c2f8cb20
|
7
|
+
data.tar.gz: 9ae940942f6da9061af709b505b327af0604bf75775e6b8c3b9824cd4bc21c08882925443b77ef382823c444671101b4096a49307ff88135e32b9ba14d8f659e
|
data/lib/adapters/base.rb
CHANGED
@@ -15,36 +15,42 @@ module JustFootball
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def post url, body
|
18
|
-
connection.post do |request|
|
18
|
+
response = connection.post do |request|
|
19
19
|
request.url url
|
20
20
|
request.headers['Content-Type'] = 'application/json'
|
21
21
|
request.body = body.to_json
|
22
22
|
end
|
23
|
+
|
24
|
+
make_response response
|
23
25
|
end
|
24
26
|
|
25
27
|
def put url, body
|
26
|
-
connection.put do |request|
|
28
|
+
response = connection.put do |request|
|
27
29
|
request.url url
|
28
30
|
request.headers['Content-Type'] = 'application/json'
|
29
31
|
request.body = body.to_json
|
30
32
|
end
|
33
|
+
|
34
|
+
make_response response
|
31
35
|
end
|
32
36
|
|
33
37
|
def get url
|
34
|
-
connection.get do |request|
|
38
|
+
response = connection.get do |request|
|
35
39
|
request.url url
|
36
40
|
request.headers['Content-Type'] = 'application/json'
|
37
41
|
end
|
42
|
+
|
43
|
+
make_response response
|
38
44
|
end
|
39
45
|
|
40
46
|
def make_json input
|
41
47
|
JSON.parse input, { symbolize_names: true }
|
42
48
|
end
|
43
49
|
|
44
|
-
def
|
50
|
+
def make_response response
|
45
51
|
{
|
46
|
-
:
|
47
|
-
:
|
52
|
+
code: response.status
|
53
|
+
status: make_json(response.body)
|
48
54
|
}
|
49
55
|
end
|
50
56
|
end
|