ravelin 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ravelin/response.rb +9 -9
- data/lib/ravelin/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: c9fd34e06b320e95e85ed96db0802051c56b6c84
|
4
|
+
data.tar.gz: f837c895a1a3d30e79a94166adac132ed6d28ebf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41fd504ab631bf9f6fa20d00805e87c4ce3edc8c87f401b800524cf7e86d46026392d393e769feb4975bc75ef230239c3f5901f495877092d8042861c744c454
|
7
|
+
data.tar.gz: bb77a2536f299d9cf6a6e688c25a15affff2217326da078de5cc0ec6c6283a13478c7d3411fee52b7b1539b069eb23dc561bc8e75953b06f50ed69542cec8d35
|
data/lib/ravelin/response.rb
CHANGED
@@ -13,11 +13,9 @@ module Ravelin
|
|
13
13
|
|
14
14
|
def initialize(faraday_response)
|
15
15
|
return if faraday_response.body.nil? || faraday_response.body.empty?
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
tag(data) if data.key?('tagNames')
|
20
|
-
event(data) if data.key?('action')
|
16
|
+
response_body = faraday_response.body
|
17
|
+
tag(response_body) if response_body.key?('tagNames')
|
18
|
+
event(response_body) if response_body.key?('data')
|
21
19
|
|
22
20
|
@http_status = faraday_response.status
|
23
21
|
@http_body = faraday_response.body
|
@@ -25,7 +23,9 @@ module Ravelin
|
|
25
23
|
|
26
24
|
private
|
27
25
|
|
28
|
-
def event(
|
26
|
+
def event(response_body)
|
27
|
+
data = response_body.fetch('data', {})
|
28
|
+
|
29
29
|
@customer_id = data['customerId']
|
30
30
|
@action = data['action']
|
31
31
|
@score = data['score']
|
@@ -35,9 +35,9 @@ module Ravelin
|
|
35
35
|
@customer_id = data['customerId']
|
36
36
|
end
|
37
37
|
|
38
|
-
def tag(
|
39
|
-
@tag_names =
|
40
|
-
@label =
|
38
|
+
def tag(response_body)
|
39
|
+
@tag_names = response_body['tagNames']
|
40
|
+
@label = response_body['label']
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
data/lib/ravelin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ravelin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Levy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-
|
14
|
+
date: 2018-12-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|