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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40391eef2a322ca4d72abb8f73904435d848ef24
4
- data.tar.gz: 5e22d77bc2591757d3c52e8809e6e29c112be30b
3
+ metadata.gz: c9fd34e06b320e95e85ed96db0802051c56b6c84
4
+ data.tar.gz: f837c895a1a3d30e79a94166adac132ed6d28ebf
5
5
  SHA512:
6
- metadata.gz: 912ba0d197c99c9f293340b9a525bc227301163089a5c6ff9a0384a90f47f3a00d6fe039f41f949c2a7891c8b1a970588d6665fcc1e4a308104e36c5d5ebd9d3
7
- data.tar.gz: ed9f943cefef237d32a54b8d36cb9adad2097e304e8aa84ba43b78e57996d0fce73a4dea63c2299cc88e8fd47bbef52372788e62af53fb0fa6dce7b8f8aece00
6
+ metadata.gz: 41fd504ab631bf9f6fa20d00805e87c4ce3edc8c87f401b800524cf7e86d46026392d393e769feb4975bc75ef230239c3f5901f495877092d8042861c744c454
7
+ data.tar.gz: bb77a2536f299d9cf6a6e688c25a15affff2217326da078de5cc0ec6c6283a13478c7d3411fee52b7b1539b069eb23dc561bc8e75953b06f50ed69542cec8d35
@@ -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
- data = faraday_response.body.fetch('data', {})
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(data)
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(data)
39
- @tag_names = data['tagNames']
40
- @label = data['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
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.15"
3
3
  end
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.14
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-11-30 00:00:00.000000000 Z
14
+ date: 2018-12-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday