eep_client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eep_client.rb +12 -4
- 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: c4dd7bd071ad6554fb3329c6ba8484c9d4a0f243
|
4
|
+
data.tar.gz: 85fda6f250d497527b8970a99f39e1605b25cb2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96c486a3ae38db0f812d32fe609d9025fa2bc64f1e295c873f7a80cbb3dff004708dad4cfe08e02dd2cfb22d815d892c12ef58c4efec404ddfd2330c465dad65
|
7
|
+
data.tar.gz: b74eef5638bec2d0776a451fed98df8214738407c0389d1bbe8d42a3090fb0de0fb0da2234d606baa65bed5424dcc595b5778589a92cd0d790ceeea03d776166
|
data/lib/eep_client.rb
CHANGED
@@ -45,8 +45,12 @@ class EepClient
|
|
45
45
|
end
|
46
46
|
if @http
|
47
47
|
headers = { ACC_HDR => APP_JSON, CON_HDR => APP_JSON }
|
48
|
-
res = @http.send_request(POST, EVENT_RESOURCE, json, headers)
|
49
|
-
|
48
|
+
res = @http.send_request(POST, EVENT_RESOURCE, json, headers)
|
49
|
+
if res.is_a? Net::HTTPServerError
|
50
|
+
res.error!
|
51
|
+
else
|
52
|
+
Response.new_instance(JSON.parse(res.body))
|
53
|
+
end
|
50
54
|
else
|
51
55
|
Response.mock_event_ok
|
52
56
|
end
|
@@ -60,8 +64,12 @@ class EepClient
|
|
60
64
|
end
|
61
65
|
if @http
|
62
66
|
headers = { ACC_HDR => APP_JSON, CON_HDR => APP_JSON }
|
63
|
-
res = @http.send_request(POST, CLEAR_RESOURCE, json, headers)
|
64
|
-
|
67
|
+
res = @http.send_request(POST, CLEAR_RESOURCE, json, headers)
|
68
|
+
if res.is_a? Net::HTTPServerError
|
69
|
+
res.error!
|
70
|
+
else
|
71
|
+
Response.new_instance(JSON.parse(res.body))
|
72
|
+
end
|
65
73
|
else
|
66
74
|
Response.mock_clear_ok
|
67
75
|
end
|