reamaze_api 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/reamaze_api/utils.rb +4 -14
- data/lib/reamaze_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: 7aaca01402e1b35bf3ca7c460046e9c5ea47a72c
|
4
|
+
data.tar.gz: d719f292bac00462d9aecd0b033db114676edea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b1f776e210c476c3bcaf9dc18d5b9fc04686b661d766d3186b76f38f0e8c3795b29fcbb09206f6d8b4adcdbc92d9a6f655c1f9959850189ee489854da275c81
|
7
|
+
data.tar.gz: 9ecabf90eda07c670f488f8cc52a13bfd887628015a6c7ea48846d9c5a655b3042bd1062ad8fc52e6b66eaec3dda4a0cd9c41d2340fe9d327a00de7157590a2f
|
data/README.md
CHANGED
@@ -104,8 +104,10 @@ client = ReamazeAPI.new brand: "invalid"
|
|
104
104
|
client.articles.all
|
105
105
|
# {
|
106
106
|
# :success => false,
|
107
|
-
#
|
108
|
-
#
|
107
|
+
# :payload => {
|
108
|
+
# :error => "ReamazeAPI::NotFound",
|
109
|
+
# :message => "GET https://invalid.reamaze.com/api/v1/articles: 404"
|
110
|
+
# }
|
109
111
|
# }
|
110
112
|
```
|
111
113
|
|
data/lib/reamaze_api/utils.rb
CHANGED
@@ -13,18 +13,6 @@ module ReamazeAPI
|
|
13
13
|
HashKeys.deep_symbolize_keys(hash)
|
14
14
|
end
|
15
15
|
|
16
|
-
# Public: Hash used for success responses.
|
17
|
-
#
|
18
|
-
# payload - Payload from API
|
19
|
-
#
|
20
|
-
# Returns a Hash.
|
21
|
-
def success_hash(payload, success = true)
|
22
|
-
symbolize_hash(
|
23
|
-
success: success,
|
24
|
-
payload: payload
|
25
|
-
)
|
26
|
-
end
|
27
|
-
|
28
16
|
# Public: Hash used for error responses.
|
29
17
|
#
|
30
18
|
# exception - An Exception instance
|
@@ -33,8 +21,10 @@ module ReamazeAPI
|
|
33
21
|
def error_hash(exception)
|
34
22
|
{
|
35
23
|
success: false,
|
36
|
-
|
37
|
-
|
24
|
+
payload: {
|
25
|
+
error: exception.class.name,
|
26
|
+
message: exception.message
|
27
|
+
}
|
38
28
|
}
|
39
29
|
end
|
40
30
|
end
|
data/lib/reamaze_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reamaze_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Priddle
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|